-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.json
179 lines (171 loc) · 5.68 KB
/
.eslintrc.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "script",
"project": "jsconfig.json"
},
"env": {
"es6": true,
"node": false,
"browser": true
},
"rules": {
// --- JavaScript ---
// Possible Errors
"no-template-curly-in-string": "error",
// Best Practices
"array-callback-return": "error",
"block-scoped-var": "error",
"curly": ["error", "multi-line"],
"dot-location": ["error", "property"],
"eqeqeq": "error",
"no-caller": "error",
"no-empty-function": "error",
"no-eq-null": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "off",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implied-eval": "error",
"no-invalid-this": "error",
"no-iterator": "error",
"no-labels": ["error", {"allowLoop": true, "allowSwitch": true}],
"no-lone-blocks": "error",
"no-loop-func": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-proto": "error",
"no-return-assign": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-throw-literal": "error",
"no-unused-expressions": "error",
"no-useless-call": "error",
"no-warning-comments": ["warn", {"terms": ["todo", "fixme", "xxx", "debug"]}],
"prefer-promise-reject-errors": "error",
"radix": "error",
"wrap-iife": ["error", "inside"],
"yoda": "error",
// Strict Mode
// Variables
"no-label-var": "error",
"no-restricted-globals": ["error", "event", "fdescribe"],
"no-use-before-define": ["error", {"functions": false, "classes": false, "variables": true}],
// Node.js and CommonJS
"callback-return": "error",
"handle-callback-err": "error",
"no-buffer-constructor": "error",
"no-path-concat": "error",
"no-new-require": "error",
"no-process-env": "error",
"no-unused-vars": ["error", {"args": "none"}],
// Stylistic Issues
"camelcase": ["error", {"properties": "never"}],
"jsx-quotes": ["error", "prefer-double"],
"linebreak-style": ["error", "unix"],
"new-cap": ["error", {"capIsNewExceptions": ["SQL", "express.Router"]}],
"new-parens": "error",
"no-array-constructor": "error",
"no-bitwise": "error",
"no-mixed-operators": "error",
"no-new-object": "error",
"no-tabs": "error",
"one-var": ["error", "never"],
"quotes": ["error", "single", {"allowTemplateLiterals": true}],
"semi": "error",
"unicode-bom": "error",
// ECMAScript 6
"no-confusing-arrow": "error",
"no-var": "error",
"prefer-arrow-callback": ["error", {"allowNamedFunctions": true}],
"prefer-const": "error",
// --- TypeScript ---
"@typescript-eslint/indent": "off",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-this-alias": "error",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error", {"functions": false, "classes": false, "variables": true, "typedefs": false}],
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-includes": "error",
"semi": "off",
"@typescript-eslint/semi": "error",
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/unified-signatures": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", {"args": "none"}],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-require-imports": "off",
"no-empty-function": "off",
"@typescript-eslint/no-empty-function": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variableLike",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"],
"leadingUnderscore": "allow"
},
{
"selector": "property",
"format": null,
"leadingUnderscore": "allow"
},
{
"selector": "memberLike",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
{
"selector": "typeLike",
"format": ["PascalCase"]
},
{
"selector": "interface",
"prefix": ["I"],
"format": ["PascalCase"]
},
{
"selector": "enum",
"prefix": ["E"],
"format": ["PascalCase"]
},
{
"selector": "enumMember",
"format": ["UPPER_CASE"]
}
]
// --- Project Specific ---
}
}