This repository was archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtslint.json
More file actions
42 lines (42 loc) · 2.28 KB
/
Copy pathtslint.json
File metadata and controls
42 lines (42 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
"lintOptions": {
"typeCheck": true
},
"extends": "./node_modules/tslint/lib/configs/all",
"rulesDirectory": [
"tslint-plugin-prettier",
"tslint-consistent-codestyle"
],
"rules": {
"indent": [ true, "spaces", 2 ],
"no-unsafe-any": false,
"completed-docs": true,
"prettier": true,
"newline-per-chained-call": false,
"naming-convention": [
true,
// forbid leading and trailing underscores and enforce camelCase on EVERY name. will be overridden by subtypes if needed
{"type": "default", "format": "camelCase", "leadingUnderscore": "forbid", "trailingUnderscore": "forbid"},
// enforce PascalCase for classes, interfaces, enums, etc. Remember, there are still no underscores allowed.
{"type": "type", "format": "PascalCase"},
// abstract classes must have the prefix "Abstract". The following part of the name must be valid PascalCase
{"type": "class", "modifiers": "abstract", "prefix": "Abstract"},
// interface names must start with "I". The following part of the name must be valid PascalCase
{"type": "interface", "prefix": "I"},
// require exported constant variables that are initialized with functions to be camelCase
{"type": "functionVariable", "modifiers": ["export", "const"], "format": "PascalCase"},
// exclicitly disable the format check only for method toJSON
{"type": "method", "filter": "^toJSON$", "format": null},
// Apply pascal case for properties with get modifier
{"type": "property", "modifiers": ["public", "get"], "format": "PascalCase"},
// generic type parameters must start with "T"
// most of the time it will only be T, which is totally valid, because an empty string conforms to the PascalCase check
// By convention T, U and V are used for generics. You could enforce that with "regex": "^[TUV]$" and if you are care that much for performance, you could disable every other check by setting a falsy value
{"type": "genericTypeParameter", "prefix": "T"},
// enum members must be in PascalCase. Without this config, enumMember would inherit UPPER_CASE from public static const property
{"type": "enumMember", "format": "PascalCase"},
// enforce PascalCase for methods
{"type": "method", "format": "PascalCase"}
]
}
}