Skip to content

Commit e9a81f2

Browse files
eslintrc: reorder rules to match order in the official docs (#3772)
1 parent a045948 commit e9a81f2

File tree

1 file changed

+100
-112
lines changed

1 file changed

+100
-112
lines changed

.eslintrc.yml

Lines changed: 100 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -182,231 +182,226 @@ rules:
182182
##############################################################################
183183

184184
# Possible Errors
185-
# https://eslint.org/docs/rules/#possible-errors
185+
# https://eslint.org/docs/latest/rules/#possible-problems
186186

187+
array-callback-return: error
188+
constructor-super: error
187189
for-direction: error
188190
getter-return: error
189191
no-async-promise-executor: error
190192
no-await-in-loop: error
193+
no-class-assign: error
191194
no-compare-neg-zero: error
192195
no-cond-assign: error
196+
no-const-assign: error
193197
no-constant-binary-expression: error
194-
no-console: warn
195198
no-constant-condition: error
199+
no-constructor-return: error
196200
no-control-regex: error
197201
no-debugger: warn
198202
no-dupe-args: error
203+
no-dupe-class-members: error
199204
no-dupe-else-if: error
200205
no-dupe-keys: error
201206
no-duplicate-case: error
202-
no-empty: error
207+
no-duplicate-imports: off # Superseded by `import/no-duplicates`
203208
no-empty-character-class: error
209+
no-empty-pattern: error
204210
no-ex-assign: error
205-
no-extra-boolean-cast: error
211+
no-fallthrough: error
206212
no-func-assign: error
207213
no-import-assign: error
208214
no-inner-declarations: [error, both]
209215
no-invalid-regexp: error
210216
no-irregular-whitespace: error
211217
no-loss-of-precision: error
212218
no-misleading-character-class: error
219+
no-new-symbol: error
213220
no-obj-calls: error
214221
no-promise-executor-return: off # TODO
215222
no-prototype-builtins: error
216-
no-regex-spaces: error
223+
no-self-assign: error
224+
no-self-compare: off # TODO
217225
no-setter-return: error
218226
no-sparse-arrays: error
219227
no-template-curly-in-string: error
228+
no-this-before-super: error
229+
no-undef: error
230+
no-unexpected-multiline: off
231+
no-unmodified-loop-condition: error
220232
no-unreachable: error
221233
no-unreachable-loop: error
222234
no-unsafe-finally: error
223235
no-unsafe-negation: error
224236
no-unsafe-optional-chaining: [error, { disallowArithmeticOperators: true }]
225237
no-unused-private-class-members: error
238+
no-unused-vars: [error, { vars: all, args: all, argsIgnorePattern: '^_' }]
239+
no-use-before-define: off
226240
no-useless-backreference: error
227241
require-atomic-updates: error
228242
use-isnan: error
229243
valid-typeof: error
230244

231-
# Best Practices
232-
# https://eslint.org/docs/rules/#best-practices
245+
# Suggestions
246+
# https://eslint.org/docs/latest/rules/#suggestions
233247

234248
accessor-pairs: error
235-
array-callback-return: error
249+
arrow-body-style: error
236250
block-scoped-var: error
251+
camelcase: error
252+
capitalized-comments: off # maybe
237253
class-methods-use-this: off
238254
complexity: off
239255
consistent-return: off
256+
consistent-this: off
240257
curly: error
241258
default-case: off
242259
default-case-last: error
243260
default-param-last: error
244261
dot-notation: error
245262
eqeqeq: [error, smart]
263+
func-name-matching: off
264+
func-names: [error, as-needed] # improve debug experience
265+
func-style: off
246266
grouped-accessor-pairs: error
247267
guard-for-in: error
268+
id-denylist: off
269+
id-length: off
270+
id-match: [error, '^(?:_?[a-zA-Z0-9]*)|[_A-Z0-9]+$']
271+
init-declarations: off
272+
logical-assignment-operators: error
248273
max-classes-per-file: off
274+
max-depth: off
275+
max-lines: off
276+
max-lines-per-function: off
277+
max-nested-callbacks: off
278+
max-params: [error, 5] # TODO: drop to default number, which is 3
279+
max-statements: off
280+
multiline-comment-style: off
281+
new-cap: error
249282
no-alert: error
283+
no-array-constructor: error
284+
no-bitwise: off
250285
no-caller: error
251286
no-case-declarations: error
252-
no-constructor-return: error
287+
no-confusing-arrow: off
288+
no-console: warn
289+
no-continue: off
290+
no-delete-var: error
253291
no-div-regex: error
254292
no-else-return: error
293+
no-empty: error
255294
no-empty-function: error
256-
no-empty-pattern: error
257295
no-eq-null: off
258296
no-eval: error
259297
no-extend-native: error
260298
no-extra-bind: error
299+
no-extra-boolean-cast: error
261300
no-extra-label: error
262-
no-fallthrough: error
301+
no-extra-semi: off
302+
no-floating-decimal: off
263303
no-global-assign: error
264304
no-implicit-coercion: error
265305
no-implicit-globals: off
266306
no-implied-eval: error
307+
no-inline-comments: off
267308
no-invalid-this: error
268309
no-iterator: error
310+
no-label-var: error
269311
no-labels: error
270312
no-lone-blocks: error
313+
no-lonely-if: error
271314
no-loop-func: error
272315
no-magic-numbers: off
316+
no-mixed-operators: off
317+
no-multi-assign: off
273318
no-multi-str: error
319+
no-negated-condition: off
320+
no-nested-ternary: off
274321
no-new: error
275322
no-new-func: error
323+
no-new-object: error
276324
no-new-wrappers: error
277325
no-nonoctal-decimal-escape: error
278326
no-octal: error
279327
no-octal-escape: error
280328
no-param-reassign: error
329+
no-plusplus: off
281330
no-proto: error
282331
no-redeclare: error
332+
no-regex-spaces: error
333+
no-restricted-exports: off
334+
no-restricted-globals: off
335+
no-restricted-imports: off
283336
no-restricted-properties: off
337+
no-restricted-syntax: off
284338
no-return-assign: error
285339
no-return-await: error
286340
no-script-url: error
287-
no-self-assign: error
288-
no-self-compare: off # TODO
289341
no-sequences: error
342+
no-shadow: error
343+
no-shadow-restricted-names: error
344+
no-ternary: off
290345
no-throw-literal: error
291-
no-unmodified-loop-condition: error
346+
no-undef-init: error
347+
no-undefined: off
348+
no-underscore-dangle: off # TODO
349+
no-unneeded-ternary: error
292350
no-unused-expressions: error
293351
no-unused-labels: error
294352
no-useless-call: error
295353
no-useless-catch: error
354+
no-useless-computed-key: error
296355
no-useless-concat: error
356+
no-useless-constructor: error
297357
no-useless-escape: error
358+
no-useless-rename: error
298359
no-useless-return: error
360+
no-var: error
299361
no-void: error
300362
no-warning-comments: off
301363
no-with: error
364+
object-shorthand: error
365+
one-var: [error, never]
366+
one-var-declaration-per-line: off
367+
operator-assignment: error
368+
prefer-arrow-callback: error
369+
prefer-const: error
370+
prefer-destructuring: off
371+
prefer-exponentiation-operator: error
302372
prefer-named-capture-group: off # ES2018
373+
prefer-numeric-literals: error
374+
prefer-object-has-own: off # TODO requires Node.js v16.9.0
375+
prefer-object-spread: error
303376
prefer-promise-reject-errors: error
304377
prefer-regex-literals: error
378+
prefer-rest-params: off # TODO
379+
prefer-spread: error
380+
prefer-template: off
381+
quote-props: off # Superseded by prettier
305382
radix: error
306383
require-await: error
307384
require-unicode-regexp: off
385+
require-yield: error
386+
sort-imports: off
387+
sort-keys: off
388+
sort-vars: off
389+
spaced-comment: error
390+
strict: error
391+
symbol-description: off
308392
vars-on-top: error
309393
yoda: [error, never, { exceptRange: true }]
310394

311-
# Strict Mode
312-
# https://eslint.org/docs/rules/#strict-mode
313-
314-
strict: error
315-
316-
# Variables
317-
# https://eslint.org/docs/rules/#variables
395+
# Layout & Formatting
396+
# https://eslint.org/docs/latest/rules/#layout--formatting
318397

319-
init-declarations: off
320-
logical-assignment-operators: error
321-
no-delete-var: error
322-
no-label-var: error
323-
no-restricted-globals: off
324-
no-shadow: error
325-
no-shadow-restricted-names: error
326-
no-undef: error
327-
no-undef-init: error
328-
no-undefined: off
329-
no-unused-vars: [error, { vars: all, args: all, argsIgnorePattern: '^_' }]
330-
no-use-before-define: off
331-
332-
# Stylistic Issues
333-
# https://eslint.org/docs/rules/#stylistic-issues
334-
335-
camelcase: error
336-
capitalized-comments: off # maybe
337-
consistent-this: off
338-
func-name-matching: off
339-
func-names: [error, as-needed] # improve debug experience
340-
func-style: off
341-
id-denylist: off
342-
id-length: off
343-
id-match: [error, '^(?:_?[a-zA-Z0-9]*)|[_A-Z0-9]+$']
344398
line-comment-position: off
345399
lines-around-comment: off
346400
lines-between-class-members: [error, always, { exceptAfterSingleLine: true }]
347-
max-depth: off
348-
max-lines: off
349-
max-lines-per-function: off
350-
max-nested-callbacks: off
351-
max-params: [error, 5] # TODO: drop to default number, which is 3
352-
max-statements: off
353401
max-statements-per-line: off
354-
multiline-comment-style: off
355-
new-cap: error
356-
no-array-constructor: error
357-
no-bitwise: off
358-
no-continue: off
359-
no-inline-comments: off
360-
no-lonely-if: error
361-
no-multi-assign: off
362-
no-negated-condition: off
363-
no-nested-ternary: off
364-
no-new-object: error
365-
no-plusplus: off
366-
no-restricted-syntax: off
367402
no-tabs: error
368-
no-ternary: off
369-
no-underscore-dangle: off # TODO
370-
no-unneeded-ternary: error
371-
one-var: [error, never]
372-
operator-assignment: error
373403
padding-line-between-statements: off
374-
prefer-exponentiation-operator: error
375-
prefer-object-spread: error
376404
quotes: [error, single, { avoidEscape: true }]
377-
sort-keys: off
378-
sort-vars: off
379-
spaced-comment: error
380-
381-
# ECMAScript 6
382-
# https://eslint.org/docs/rules/#ecmascript-6
383-
384-
arrow-body-style: error
385-
constructor-super: error
386-
no-class-assign: error
387-
no-const-assign: error
388-
no-dupe-class-members: error
389-
no-duplicate-imports: off # Superseded by `import/no-duplicates`
390-
no-new-symbol: error
391-
no-restricted-exports: off
392-
no-restricted-imports: off
393-
no-this-before-super: error
394-
no-useless-computed-key: error
395-
no-useless-constructor: error
396-
no-useless-rename: error
397-
no-var: error
398-
object-shorthand: error
399-
prefer-arrow-callback: error
400-
prefer-const: error
401-
prefer-destructuring: off
402-
prefer-numeric-literals: error
403-
prefer-object-has-own: off # TODO requires Node.js v16.9.0
404-
prefer-rest-params: off # TODO
405-
prefer-spread: error
406-
prefer-template: off
407-
require-yield: error
408-
sort-imports: off
409-
symbol-description: off
410405

411406
# Bellow rules are disabled because coflicts with Prettier, see:
412407
# https://github.com/prettier/eslint-config-prettier/blob/master/index.js
@@ -437,25 +432,18 @@ rules:
437432
multiline-ternary: off
438433
newline-per-chained-call: off
439434
new-parens: off
440-
no-confusing-arrow: off
441435
no-extra-parens: off
442-
no-extra-semi: off
443-
no-floating-decimal: off
444-
no-mixed-operators: off
445436
no-mixed-spaces-and-tabs: off
446437
no-multi-spaces: off
447438
no-multiple-empty-lines: off
448439
no-trailing-spaces: off
449-
no-unexpected-multiline: off
450440
no-whitespace-before-property: off
451441
nonblock-statement-body-position: off
452442
object-curly-newline: off
453443
object-curly-spacing: off
454444
object-property-newline: off
455-
one-var-declaration-per-line: off
456445
operator-linebreak: off
457446
padded-blocks: off
458-
quote-props: off
459447
rest-spread-spacing: off
460448
semi: off
461449
semi-spacing: off

0 commit comments

Comments
 (0)