-
Notifications
You must be signed in to change notification settings - Fork 0
/
tslint.json
103 lines (103 loc) · 2.33 KB
/
tslint.json
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
"extends": [
"tslint:recommended",
"tslint-react",
"tslint-react-hooks"
],
"rulesDirectory": [
"src/"
],
"rules": {
"member-access": false,
// 分号
"semicolon": true,
// 缩进
"indent": [
true,
"spaces"
],
"arrow-parens": false,
// 去除对象中的尾逗号
"trailing-comma": [
true,
"always"
],
"max-classes-per-file": [
true,
5
],
"max-file-line-count": [
true,
1000
],
"curly": [
true,
"ignore-same-line"
],
"max-line-length": [
true,
{
"limit": 120,
"ignore-pattern": "^import |^export {(.*?)}"
}
],
"no-implicit-dependencies": false,
"no-submodule-imports": false,
"member-ordering": false,
"object-literal-sort-keys": false,
"object-literal-key-quotes": false,
"ordered-imports": false,
"one-line": false,
"jsx-no-multiline-js": false,
"jsx-self-close": false,
"jsx-no-lambda": false,
"jsx-alignment": false,
// 不允许 export default 写法
// "no-default-export": true,
// 字符串使用单引号
"quotemark": [
false,
"single"
],
// 不允许在条件表达式中赋值,如:if(var a = 1)
"no-conditional-assignment": true,
// 不允许使用 new Number() 等用法,Number("1")可以使用
"no-construct": true,
"no-debugger": true,
// Warns if ‘super()’ appears twice in a constructor.
"no-duplicate-super": true,
// Disallows using the this keyword outside of classes.
"no-invalid-this": true,
// 禁止使用var申明变量
"no-var-keyword": true,
"jsx-wrap-multiline": false,
// 最大连续空行数
"no-consecutive-blank-lines": [
true,
3
],
// 去除行尾空格
"no-trailing-whitespace": true,
// 变量名允许驼峰命名,不能使用TS关键字作为变量名
"variable-name": [
true,
"ban-keywords",
"check-format",
"allow-pascal-case"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock"
],
"react-hooks-nesting": "error"
}
}