-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate eslint config eslint/all into dedicated rules for bette…
…r semver support (#30)
- Loading branch information
Showing
2 changed files
with
209 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,217 @@ | ||
module.exports = { | ||
extends: ['eslint:all', 'prettier'], | ||
rules: { | ||
'one-var': ['error', 'never'], | ||
'no-magic-numbers': 'off', | ||
'sort-keys': 'off', | ||
'sort-imports': 'off', | ||
// https://eslint.org/docs/latest/rules | ||
|
||
// Possible Problems | ||
'array-callback-return': 'error', | ||
'constructor-super': 'error', | ||
'for-direction': 'error', | ||
'getter-return': 'error', | ||
'no-async-promise-executor': 'error', | ||
'no-await-in-loop': 'error', | ||
'no-class-assign': 'error', | ||
'no-compare-neg-zero': 'error', | ||
'no-cond-assign': 'error', | ||
'no-const-assign': 'error', | ||
'no-constant-binary-expression': 'error', | ||
'no-constant-condition': 'error', | ||
'no-constructor-return': 'error', | ||
'no-control-regex': 'error', | ||
'no-debugger': 'error', | ||
'no-dupe-args': 'error', | ||
'no-dupe-class-members': 'error', | ||
'no-dupe-else-if': 'error', | ||
'no-dupe-keys': 'error', | ||
'no-duplicate-case': 'error', | ||
'no-duplicate-imports': 'error', | ||
'no-empty-character-class': 'error', | ||
'no-empty-pattern': 'error', | ||
'no-ex-assign': 'error', | ||
'no-fallthrough': 'error', | ||
'no-func-assign': 'error', | ||
'no-import-assign': 'error', | ||
'no-inner-declarations': 'error', | ||
'no-invalid-regexp': 'error', | ||
'no-irregular-whitespace': 'error', | ||
'no-loss-of-precision': 'error', | ||
'no-misleading-character-class': 'error', | ||
'no-new-native-nonconstructor': 'error', | ||
'no-new-symbol': 'error', | ||
'no-obj-calls': 'error', | ||
'no-promise-executor-return': 'error', | ||
'no-prototype-builtins': 'error', | ||
'no-self-assign': 'error', | ||
'no-self-compare': 'error', | ||
'no-setter-return': 'error', | ||
'no-sparse-arrays': 'error', | ||
'no-template-curly-in-string': 'error', | ||
'no-this-before-super': 'error', | ||
'no-undef': 'error', | ||
'no-unexpected-multiline': 'off', // conflicts with prettier | ||
'no-unmodified-loop-condition': 'error', | ||
'no-unreachable': 'error', | ||
'no-unreachable-loop': 'error', | ||
'no-unsafe-finally': 'error', | ||
'no-unsafe-negation': 'error', | ||
'no-unsafe-optional-chaining': 'error', | ||
'no-unused-private-class-members': 'error', | ||
'no-unused-vars': 'error', | ||
'no-use-before-define': 'error', | ||
'no-useless-backreference': 'error', | ||
'require-atomic-updates': 'error', | ||
'use-isnan': 'error', | ||
'valid-typeof': 'error', | ||
|
||
// Suggestions | ||
'accessor-pairs': 'error', | ||
'arrow-body-style': 'off', | ||
'block-scoped-var': 'error', | ||
camelcase: 'off', | ||
'capitalized-comments': 'off', | ||
'class-methods-use-this': 'off', | ||
complexity: 'error', | ||
'consistent-return': 'off', | ||
'consistent-this': 'error', | ||
curly: ['error', 'all'], | ||
'default-case': 'error', | ||
'default-case-last': 'error', | ||
'default-param-last': 'error', | ||
'dot-notation': 'error', | ||
eqeqeq: 'error', | ||
'func-name-matching': 'error', | ||
'func-names': 'error', | ||
'func-style': 'error', | ||
'grouped-accessor-pairs': 'error', | ||
'guard-for-in': 'error', | ||
'id-denylist': 'error', | ||
'id-length': 'off', | ||
'id-match': 'error', | ||
'init-declarations': 'off', | ||
'logical-assignment-operators': 'error', | ||
'max-classes-per-file': 'off', | ||
'max-depth': 'error', | ||
'max-lines': 'off', | ||
'max-lines-per-function': 'off', | ||
'max-nested-callbacks': 'error', | ||
'max-params': 'error', | ||
'max-statements': 'off', | ||
'max-lines': 'off', | ||
'max-params': 'off', | ||
'max-classes-per-file': 'off', | ||
'id-length': 'off', | ||
'no-warning-comments': 'off', | ||
'no-ternary': 'off', | ||
'multiline-comment-style': 'off', | ||
'new-cap': 'off', | ||
'no-alert': 'error', | ||
'no-array-constructor': 'error', | ||
'no-bitwise': 'error', | ||
'no-caller': 'error', | ||
'no-case-declarations': 'error', | ||
'no-confusing-arrow': 'off', // conflicts with prettier | ||
'no-console': 'error', | ||
'no-continue': 'off', | ||
'no-undefined': 'off', | ||
'no-await-in-loop': 'off', | ||
'no-delete-var': 'error', | ||
'no-div-regex': 'error', | ||
'no-else-return': 'error', | ||
'no-empty': 'error', | ||
'no-empty-function': ['error', { allow: ['arrowFunctions'] }], | ||
'no-empty-static-block': 'error', | ||
'no-eq-null': 'error', | ||
'no-eval': 'error', | ||
'no-extend-native': 'error', | ||
'no-extra-bind': 'error', | ||
'no-extra-boolean-cast': 'error', | ||
'no-extra-label': 'error', | ||
'no-extra-semi': 'off', // conflicts with prettier | ||
'no-floating-decimal': 'off', // conflicts with prettier | ||
'no-global-assign': 'error', | ||
'no-implicit-coercion': 'error', | ||
'no-implicit-globals': 'error', | ||
'no-implied-eval': 'error', | ||
'no-inline-comments': 'off', | ||
'no-invalid-this': 'error', | ||
'no-iterator': 'error', | ||
'no-label-var': 'error', | ||
'no-labels': 'error', | ||
'no-lone-blocks': 'error', | ||
'no-lonely-if': 'error', | ||
'no-loop-func': 'error', | ||
'no-magic-numbers': 'off', // not sure about it | ||
'no-mixed-operators': 'off', // conflicts with prettier | ||
'no-multi-assign': 'error', | ||
'no-multi-str': 'error', | ||
'no-negated-condition': 'error', | ||
'no-nested-ternary': 'error', | ||
'no-new': 'error', | ||
'no-new-func': 'error', | ||
'no-new-object': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-nonoctal-decimal-escape': 'error', | ||
'no-octal': 'error', | ||
'no-octal-escape': 'error', | ||
'no-param-reassign': 'error', | ||
'no-plusplus': 'off', | ||
'no-proto': 'error', | ||
'no-redeclare': 'error', | ||
'no-regex-spaces': 'error', | ||
'no-restricted-exports': 'error', | ||
'no-restricted-globals': 'error', | ||
'no-restricted-imports': 'error', | ||
'no-restricted-properties': 'error', | ||
'no-restricted-syntax': 'error', | ||
'no-return-assign': 'error', | ||
'no-return-await': 'error', | ||
'no-script-url': 'error', | ||
'no-sequences': 'error', | ||
'no-shadow': 'off', | ||
'no-shadow-restricted-names': 'error', | ||
'no-ternary': 'off', | ||
'no-throw-literal': 'error', | ||
'no-undef-init': 'error', | ||
'no-undefined': 'off', | ||
'no-underscore-dangle': 'error', | ||
'no-unneeded-ternary': 'error', | ||
'no-unused-expressions': 'error', | ||
'no-unused-labels': 'error', | ||
'no-useless-call': 'error', | ||
'no-useless-catch': 'error', | ||
'no-useless-computed-key': 'error', | ||
'no-useless-concat': 'error', | ||
'no-useless-constructor': 'off', | ||
'new-cap': 'off', | ||
camelcase: 'off', | ||
'capitalized-comments': 'off', | ||
'lines-between-class-members': 'off', | ||
'require-unicode-regexp': 'off', | ||
'init-declarations': 'off', | ||
'multiline-comment-style': 'off', | ||
'consistent-return': 'off', | ||
'no-useless-escape': 'error', | ||
'no-useless-rename': 'error', | ||
'no-useless-return': 'error', | ||
'no-var': 'error', | ||
'no-void': 'error', | ||
'no-warning-comments': 'off', | ||
'no-with': 'error', | ||
'object-shorthand': 'error', | ||
'one-var': ['error', 'never'], | ||
'one-var-declaration-per-line': 'off', // conflicts with prettier | ||
'operator-assignment': 'error', | ||
'prefer-arrow-callback': 'error', | ||
'prefer-const': 'error', | ||
'prefer-destructuring': 'error', | ||
'prefer-exponentiation-operator': 'error', | ||
'prefer-named-capture-group': 'off', | ||
'class-methods-use-this': 'off', | ||
'no-shadow': 'off', | ||
'no-empty-function': [ | ||
'error', | ||
{ | ||
allow: ['arrowFunctions'], | ||
}, | ||
], | ||
'prefer-numeric-literals': 'error', | ||
'prefer-object-has-own': 'error', | ||
'prefer-object-spread': 'error', | ||
'prefer-promise-reject-errors': 'error', | ||
'prefer-regex-literals': 'error', | ||
'prefer-rest-params': 'error', | ||
'prefer-spread': 'error', | ||
'prefer-template': 'error', | ||
'quote-props': 'off', // conflicts with prettier | ||
radix: 'error', | ||
'require-await': 'error', | ||
'require-unicode-regexp': 'off', // not sure about it | ||
'require-yield': 'error', | ||
'sort-imports': 'off', | ||
'sort-keys': 'off', | ||
'sort-vars': 'off', | ||
'spaced-comment': 'error', | ||
strict: 'error', | ||
'symbol-description': 'error', | ||
'vars-on-top': 'error', | ||
yoda: 'error', | ||
|
||
// Layout & formatting | ||
// it should be handled by prettier | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters