-
Notifications
You must be signed in to change notification settings - Fork 456
/
.eslintrc.js
251 lines (251 loc) · 7.69 KB
/
.eslintrc.js
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
module.exports = {
env: {
browser: true,
es6: true,
node: true,
mocha: false,
jest: true,
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
plugins: ['import'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2017,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
globals: {},
rules: {
'accessor-pairs': 'warn',
'array-bracket-spacing': 'warn',
'array-callback-return': 'warn',
'arrow-body-style': 'warn',
'arrow-spacing': 'warn',
//'block-scoped-var': 'warn',
'block-spacing': 'warn',
'brace-style': 'warn',
'callback-return': 'warn',
camelcase: 'warn',
'capitalized-comments': [
'warn',
'always',
{
ignorePattern: '.*:|pragma|ignored|prettier',
ignoreInlineComments: true,
ignoreConsecutiveComments: true,
},
],
// New tool classes have callbacks and other interfaces that require implementation
// that may not necessarily require/use `this`
// "class-methods-use-this": "warn",
'comma-spacing': [
'warn',
{
after: true,
before: false,
},
],
'comma-style': 'warn',
//'complexity': 'warn',
'computed-property-spacing': 'warn',
//'consistent-return': 'warn',
'consistent-this': 'warn',
curly: 'warn',
//'default-case': 'warn',
'dot-notation': 'warn',
'eol-last': 'warn',
eqeqeq: 'warn',
'func-call-spacing': 'warn',
'func-name-matching': 'warn',
'func-names': ['warn', 'never'],
//'func-style': 'warn',
'generator-star-spacing': 'warn',
'global-require': 'warn',
//'guard-for-in': 'warn',
'handle-callback-err': 'warn',
'id-blacklist': 'warn',
'id-length': 'off',
'id-match': 'warn',
// Prettier has more nuanced rules for indent depending on the scenario.
// Remove this rule allows it to apply those nuances without conflict
// indent: ['warn', 2],
//'init-declarations': 'warn',
'import/default': 'warn',
'import/export': 'warn',
'import/extensions': ['warn', { js: 'ignorePackages' }],
'import/first': 'warn',
'import/named': 'warn',
'import/namespace': 'warn',
'import/newline-after-import': 'warn',
'import/no-unresolved': 'warn',
'import/no-webpack-loader-syntax': 'warn',
'key-spacing': 'warn',
'linebreak-style': ['warn', 'unix'],
// Conflicts with prettier's rules around condensing object properties
// We'll let prettier handle this one to prevent conflicts
// 'lines-around-comment': 'warn',
'lines-around-directive': 'warn',
'max-nested-callbacks': 'warn',
'max-statements-per-line': 'warn',
'multiline-ternary': 'off',
'new-cap': 'warn',
'new-parens': 'warn',
'newline-after-var': 'warn',
'newline-before-return': 'warn',
//'newline-per-chained-call': 'warn',
// We have some tools that utilize this when requesting values from the end user (arrowAnnotate)
// To disable for a single file, use: /* eslint no-alert: 0 */
'no-alert': 'warn',
'no-array-constructor': 'warn',
'no-bitwise': 'warn',
'no-caller': 'warn',
'no-catch-shadow': 'warn',
'no-confusing-arrow': 'warn',
'no-console': 'off',
'no-div-regex': 'warn',
'no-duplicate-imports': 'warn',
'no-else-return': 'warn',
'no-empty-function': 'off',
'no-eq-null': 'warn',
'no-eval': 'warn',
'no-extend-native': 'warn',
'no-extra-bind': 'warn',
'no-extra-label': 'warn',
'no-extra-parens': 'off',
'no-floating-decimal': 'warn',
'no-implicit-coercion': 'warn',
'no-implicit-globals': 'warn',
'no-implied-eval': 'warn',
'no-invalid-this': 'off',
'no-iterator': 'warn',
'no-label-var': 'warn',
'no-labels': 'warn',
'no-lone-blocks': 'warn',
'no-lonely-if': 'warn',
'no-loop-func': 'warn',
'no-magic-numbers': 'off',
//'no-mixed-operators': 'warn',
'no-mixed-requires': 'warn',
'no-multi-spaces': 'warn',
'no-multi-str': 'warn',
'no-multiple-empty-lines': 'warn',
'no-native-reassign': 'warn',
'no-negated-condition': 'warn',
'no-negated-in-lhs': 'warn',
'no-nested-ternary': 'warn',
'no-new-func': 'warn',
'no-new-object': 'warn',
'no-new-require': 'warn',
'no-new-wrappers': 'warn',
'no-octal-escape': 'warn',
//'no-param-reassign': 'warn',
'no-path-concat': 'warn',
'no-process-env': 'warn',
'no-process-exit': 'warn',
'no-proto': 'warn',
//'no-prototype-builtins': 'warn',
'no-restricted-globals': 'warn',
'no-restricted-imports': 'warn',
'no-restricted-modules': 'warn',
'no-restricted-properties': 'warn',
'no-restricted-syntax': 'warn',
'no-return-assign': 'warn',
'no-return-await': 'warn',
'no-script-url': 'warn',
'no-self-compare': 'warn',
'no-sequences': 'warn',
//'no-shadow': 'warn',
'no-shadow-restricted-names': 'warn',
'no-spaced-func': 'warn',
'no-sync': 'warn',
'no-tabs': 'warn',
'no-template-curly-in-string': 'warn',
'no-ternary': 'off',
'no-throw-literal': 'warn',
'no-trailing-spaces': 'warn',
'no-undef': 'error',
'no-undef-init': 'warn',
'no-undefined': 'off',
'no-unused-vars': 'warn',
'no-unmodified-loop-condition': 'warn',
'no-unneeded-ternary': 'warn',
'no-unused-expressions': 'warn',
//'no-use-before-define': 'warn',
'no-useless-call': 'warn',
'no-useless-computed-key': 'warn',
'no-useless-concat': 'warn',
'no-useless-constructor': 'warn',
'no-useless-escape': 'warn',
'no-useless-rename': 'warn',
'no-useless-return': 'off',
'no-var': 'warn',
'no-void': 'warn',
//'no-warning-comments': 'warn',
'no-whitespace-before-property': 'warn',
'no-with': 'warn',
'object-curly-spacing': ['warn', 'always'],
'object-property-newline': 'warn',
'object-shorthand': 'warn',
'one-var': 'off',
'one-var-declaration-per-line': 'warn',
'operator-assignment': 'warn',
'operator-linebreak': 'warn',
'padded-blocks': 'off',
'prefer-arrow-callback': 'off',
'prefer-const': 'warn',
'prefer-numeric-literals': 'warn',
'prefer-rest-params': 'warn',
'prefer-spread': 'warn',
'prefer-template': 'warn',
'quote-props': ['warn', 'as-needed'],
// Prettier takes care of this for us,
// But may revert to double quotes to avoid escaping characters
// quotes: ['warn', 'single'],
radix: 'warn',
'require-await': 'warn',
'rest-spread-spacing': 'warn',
semi: 'warn',
'semi-spacing': 'warn',
'sort-imports': 'off',
'sort-keys': 'off',
'sort-vars': 'off',
// @jamesapetts, can you get this to work?
// Having issues auto-fixing this
//'space-before-function-paren': ['warn', 'always'],
'space-before-blocks': 'warn',
'space-in-parens': ['warn', 'never'],
'space-infix-ops': 'warn',
'space-unary-ops': 'warn',
'spaced-comment': 'warn',
strict: 'warn',
'symbol-description': 'warn',
'template-curly-spacing': 'warn',
'unicode-bom': ['warn', 'never'],
// Helfpul for spotting issues, but is flaky
'valid-jsdoc': [
'warn',
{
prefer: {
arg: 'param',
argument: 'param',
return: 'returns',
virtual: 'abstract',
},
preferType: {
object: 'Object', // Uppercase
},
requireReturn: true,
// Require description, or a pattern in description
// Issue here if we only want to provide a `@classdesc`
// matchDescription: '.+',
requireParamDescription: false,
requireReturnDescription: false,
},
],
'vars-on-top': 'warn',
'wrap-iife': ['warn', 'inside'],
'yield-star-spacing': 'warn',
yoda: 'warn',
},
};