diff --git a/core/deprecated.js b/core/deprecated.js index 3365c39..5c6b8e2 100644 --- a/core/deprecated.js +++ b/core/deprecated.js @@ -1,121 +1,25 @@ -/** - * These rules have been deprecated in accordance with the - * [deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), and replaced by newer - * rules. - */ module.exports = { - /** - * https://eslint.org/docs/latest/rules/callback-return - */ 'callback-return': 'off', - - /** - * https://eslint.org/docs/latest/rules/global-require - */ 'global-require': 'off', - - /** - * https://eslint.org/docs/latest/rules/handle-callback-err - */ 'handle-callback-err': 'off', - - /** - * https://eslint.org/docs/latest/rules/id-blacklist - */ 'id-blacklist': 'off', - - /** - * https://eslint.org/docs/latest/rules/indent-legacy - */ 'indent-legacy': 'off', - - /** - * https://eslint.org/docs/latest/rules/lines-around-directive - */ 'lines-around-directive': 'off', - - /** - * https://eslint.org/docs/latest/rules/newline-after-var - */ 'newline-after-var': 'off', - - /** - * https://eslint.org/docs/latest/rules/newline-before-return - */ 'newline-before-return': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-buffer-constructor - */ 'no-buffer-constructor': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-catch-shadow - */ 'no-catch-shadow': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-mixed-requires - */ 'no-mixed-requires': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-native-reassign - */ 'no-native-reassign': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-negated-in-lhs - */ 'no-negated-in-lhs': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-new-require - */ 'no-new-require': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-path-concat - */ 'no-path-concat': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-process-env - */ 'no-process-env': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-process-exit - */ 'no-process-exit': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-restricted-modules - */ 'no-restricted-modules': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-spaced-func - */ 'no-spaced-func': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-sync - */ 'no-sync': 'off', - - /** - * https://eslint.org/docs/latest/rules/prefer-reflect - */ 'prefer-reflect': 'off', - - /** - * https://eslint.org/docs/latest/rules/require-jsdoc - */ 'require-jsdoc': 'off', - - /** - * https://eslint.org/docs/latest/rules/valid-jsdoc - */ 'valid-jsdoc': 'off' } diff --git a/core/layout.js b/core/layout.js index 77f5c5a..233daf2 100644 --- a/core/layout.js +++ b/core/layout.js @@ -1,178 +1,30 @@ const prettier = require('../utils/prettier.js') -/** - * These rules relate to style guidelines, and are therefore quite subjective. - */ module.exports = { - /** - * https://eslint.org/docs/latest/rules/array-bracket-newline - * - * Prettier - */ 'array-bracket-newline': 'off', - - /** - * https://eslint.org/docs/latest/rules/array-bracket-spacing - * - * Prettier - */ 'array-bracket-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/array-element-newline - * - * Prettier - */ 'array-element-newline': 'off', - - /** - * https://eslint.org/docs/latest/rules/arrow-parens - * - * Prettier - */ 'arrow-parens': 'off', - - /** - * https://eslint.org/docs/latest/rules/arrow-spacing - * - * Prettier - */ 'arrow-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/block-spacing - * - * Prettier - */ 'block-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/brace-style - * - * Prettier - */ 'brace-style': 'off', - - /** - * https://eslint.org/docs/latest/rules/comma-dangle - * - * Prettier - */ 'comma-dangle': 'off', - - /** - * https://eslint.org/docs/latest/rules/comma-spacing - * - * Prettier - */ 'comma-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/comma-style - * - * Prettier - */ 'comma-style': 'off', - - /** - * https://eslint.org/docs/latest/rules/computed-property-spacing - * - * Prettier - */ 'computed-property-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/dot-location - * - * Prettier - */ 'dot-location': 'off', - - /** - * https://eslint.org/docs/latest/rules/eol-last - * - * Prettier - */ 'eol-last': 'off', - - /** - * https://eslint.org/docs/latest/rules/func-call-spacing - * - * Prettier - */ 'func-call-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/function-call-argument-newline - * - * Prettier - */ 'function-call-argument-newline': 'off', - - /** - * https://eslint.org/docs/latest/rules/function-paren-newline - * - * Prettier - */ 'function-paren-newline': 'off', - - /** - * https://eslint.org/docs/latest/rules/generator-star-spacing - * - * Prettier - */ 'generator-star-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/implicit-arrow-linebreak - * - * Prettier - */ 'implicit-arrow-linebreak': 'off', - - /** - * https://eslint.org/docs/latest/rules/indent - * - * Prettier - */ indent: 'off', - - /** - * https://eslint.org/docs/latest/rules/jsx-quotes - * - * Prettier - */ 'jsx-quotes': 'off', - - /** - * https://eslint.org/docs/latest/rules/key-spacing - * - * Prettier - */ 'key-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/keyword-spacing - * - * Prettier - */ 'keyword-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/line-comment-position - */ 'line-comment-position': 'error', - - /** - * https://eslint.org/docs/latest/rules/linebreak-style - * - * Prettier - */ 'linebreak-style': 'off', - - /** - * https://eslint.org/docs/latest/rules/lines-around-comment - */ 'lines-around-comment': [ 'error', { @@ -182,267 +34,55 @@ module.exports = { allowClassStart: true } ], - - /** - * https://eslint.org/docs/latest/rules/lines-between-class-members - */ 'lines-between-class-members': 'error', - - /** - * https://eslint.org/docs/latest/rules/max-len - */ 'max-len': [ 'error', { code: prettier.js.printWidth, - ignorePattern: /^(?!\s+(\/\/|\*))|eslint-disable/.source, + ignorePattern: /^(?!\s+(\/\/|\))|eslint-disable/.source, ignoreUrls: true, ignoreRegExpLiterals: true, ignoreStrings: true, ignoreTemplateLiterals: true } ], - - /** - * https://eslint.org/docs/latest/rules/max-statements-per-line - * - * Handled by Prettier. - */ 'max-statements-per-line': 'off', - - /** - * https://eslint.org/docs/latest/rules/multiline-ternary - * - * Prettier - */ 'multiline-ternary': 'off', - - /** - * https://eslint.org/docs/latest/rules/new-parens - * - * Prettier - */ 'new-parens': 'off', - - /** - * https://eslint.org/docs/latest/rules/newline-per-chained-call - * - * Prettier - */ 'newline-per-chained-call': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-extra-parens - * - * Prettier - */ 'no-extra-parens': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs - * - * Prettier - */ 'no-mixed-spaces-and-tabs': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-multi-spaces - * - * Prettier - */ 'no-multi-spaces': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-multiple-empty-lines - * - * Prettier - */ 'no-multiple-empty-lines': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-tabs - */ 'no-tabs': ['error', { allowIndentationTabs: true }], - - /** - * https://eslint.org/docs/latest/rules/no-trailing-spaces - * - * Prettier - */ 'no-trailing-spaces': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-whitespace-before-property - * - * Prettier - */ 'no-whitespace-before-property': 'off', - - /** - * https://eslint.org/docs/latest/rules/nonblock-statement-body-position - * - * Prettier - */ 'nonblock-statement-body-position': 'off', - - /** - * https://eslint.org/docs/latest/rules/object-curly-newline - * - * Prettier - */ 'object-curly-newline': 'off', - - /** - * https://eslint.org/docs/latest/rules/object-curly-spacing - * - * Prettier - */ 'object-curly-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/object-property-newline - * - * Prettier - */ 'object-property-newline': 'off', - - /** - * https://eslint.org/docs/latest/rules/operator-linebreak - * - * Prettier - */ 'operator-linebreak': 'off', - - /** - * https://eslint.org/docs/latest/rules/padded-blocks - * - * Prettier - */ 'padded-blocks': 'off', - - /** - * https://eslint.org/docs/latest/rules/padding-line-between-statements - */ 'padding-line-between-statements': 'off', - - /** - * https://eslint.org/docs/latest/rules/quotes - */ quotes: [ 'error', prettier.js.singleQuote ? 'single' : 'double', { avoidEscape: true, allowTemplateLiterals: false } ], - - /** - * https://eslint.org/docs/latest/rules/rest-spread-spacing - * - * Prettier - */ 'rest-spread-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/semi - * - * Prettier - */ semi: 'off', - - /** - * https://eslint.org/docs/latest/rules/semi-spacing - * - * Prettier - */ 'semi-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/semi-style - * - * Prettier - */ 'semi-style': 'off', - - /** - * https://eslint.org/docs/latest/rules/space-before-blocks - * - * Prettier - */ 'space-before-blocks': 'off', - - /** - * https://eslint.org/docs/latest/rules/space-before-function-paren - * - * Prettier - */ 'space-before-function-paren': 'off', - - /** - * https://eslint.org/docs/latest/rules/space-in-parens - * - * Prettier - */ 'space-in-parens': 'off', - - /** - * https://eslint.org/docs/latest/rules/space-infix-ops - * - * Prettier - */ 'space-infix-ops': 'off', - - /** - * https://eslint.org/docs/latest/rules/space-unary-ops - * - * Prettier - */ 'space-unary-ops': 'off', - - /** - * https://eslint.org/docs/latest/rules/switch-colon-spacing - * - * Prettier - */ 'switch-colon-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/template-curly-spacing - * - * Prettier - */ 'template-curly-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/template-tag-spacing - * - * Prettier - */ 'template-tag-spacing': 'off', - - /** - * https://eslint.org/docs/latest/rules/unicode-bom - * - * Prettier - */ 'unicode-bom': 'off', - - /** - * https://eslint.org/docs/latest/rules/wrap-iife - * - * Prettier - */ 'wrap-iife': 'off', - - /** - * https://eslint.org/docs/latest/rules/wrap-regex - * - * Prettier - */ 'wrap-regex': 'off', - - /** - * https://eslint.org/docs/latest/rules/yield-star-spacing - * - * Prettier - */ 'yield-star-spacing': 'off' } diff --git a/core/problem.js b/core/problem.js index 1b246e2..27dd1b7 100644 --- a/core/problem.js +++ b/core/problem.js @@ -1,298 +1,60 @@ -/** - * These rules relate to possible syntax or logic errors in JavaScript code. - */ module.exports = { - /** - * https://eslint.org/docs/latest/rules/array-callback-return - */ 'array-callback-return': ['error', { allowImplicit: true }], - - /** - * https://eslint.org/docs/latest/rules/constructor-super - */ 'constructor-super': 'error', - - /** - * https://eslint.org/docs/latest/rules/for-direction - */ 'for-direction': 'error', - - /** - * https://eslint.org/docs/latest/rules/getter-return - */ 'getter-return': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-async-promise-executor - */ 'no-async-promise-executor': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-await-in-loop - */ 'no-await-in-loop': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-class-assign - */ 'no-class-assign': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-compare-neg-zero - */ 'no-compare-neg-zero': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-cond-assign - */ 'no-cond-assign': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-const-assign - */ 'no-const-assign': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-constant-binary-expression - */ 'no-constant-binary-expression': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-constant-condition - */ 'no-constant-condition': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-constructor-return - */ 'no-constructor-return': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-control-regex - */ 'no-control-regex': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-debugger - */ 'no-debugger': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-dupe-args - */ 'no-dupe-args': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-dupe-class-members - */ 'no-dupe-class-members': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-dupe-else-if - */ 'no-dupe-else-if': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-dupe-keys - */ 'no-dupe-keys': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-duplicate-case - */ 'no-duplicate-case': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-duplicate-imports - */ 'no-duplicate-imports': ['error', { includeExports: true }], - - /** - * https://eslint.org/docs/latest/rules/no-empty-character-class - */ 'no-empty-character-class': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-empty-pattern - */ 'no-empty-pattern': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-ex-assign - */ 'no-ex-assign': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-fallthrough - */ 'no-fallthrough': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-func-assign - */ 'no-func-assign': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-import-assign - */ 'no-import-assign': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-inner-declarations - */ 'no-inner-declarations': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-invalid-regexp - */ 'no-invalid-regexp': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-irregular-whitespace - */ 'no-irregular-whitespace': ['error', { skipStrings: false }], - - /** - * https://eslint.org/docs/latest/rules/no-loss-of-precision - */ 'no-loss-of-precision': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-misleading-character-class - */ 'no-misleading-character-class': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-new-native-nonconstructor - */ 'no-new-native-nonconstructor': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-new-symbol - */ 'no-new-symbol': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-obj-calls - */ 'no-obj-calls': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-promise-executor-return - */ 'no-promise-executor-return': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-prototype-builtins - */ 'no-prototype-builtins': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-self-assign - */ 'no-self-assign': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-self-compare - */ 'no-self-compare': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-setter-return - */ 'no-setter-return': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-sparse-arrays - */ 'no-sparse-arrays': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-template-curly-in-string - */ 'no-template-curly-in-string': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-this-before-super - */ 'no-this-before-super': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-undef - */ 'no-undef': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-unexpected-multiline - * - * This causes issues with some Prettier configurations. Just use semicolons. - */ 'no-unexpected-multiline': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-unmodified-loop-condition - * - * The condition may change by function calls. - */ 'no-unmodified-loop-condition': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-unreachable - */ 'no-unreachable': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-unreachable-loop - */ 'no-unreachable-loop': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-unsafe-finally - */ 'no-unsafe-finally': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-unsafe-negation - */ 'no-unsafe-negation': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining - */ 'no-unsafe-optional-chaining': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-unused-private-class-members - */ 'no-unused-private-class-members': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-unused-vars - */ 'no-unused-vars': ['error', { ignoreRestSiblings: true }], - - /** - * https://eslint.org/docs/latest/rules/no-use-before-define - */ 'no-use-before-define': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-useless-backreference - */ 'no-useless-backreference': 'error', - - /** - * https://eslint.org/docs/latest/rules/require-atomic-updates - */ 'require-atomic-updates': 'off', - - /** - * https://eslint.org/docs/latest/rules/use-isnan - */ 'use-isnan': ['error', { enforceForIndexOf: true }], - - /** - * https://eslint.org/docs/latest/rules/valid-typeof - */ 'valid-typeof': 'error' } diff --git a/core/suggestion.js b/core/suggestion.js index d5b3158..fcda599 100644 --- a/core/suggestion.js +++ b/core/suggestion.js @@ -2,33 +2,11 @@ const confusingBrowserGlobals = require('confusing-browser-globals') const allowedProperties = require('../utils/allowedProperties.js') -/** - * These rules relate to better ways of doing things to help you avoid problems. - */ module.exports = { - /** - * https://eslint.org/docs/latest/rules/accessor-pairs - */ 'accessor-pairs': 'error', - - /** - * https://eslint.org/docs/latest/rules/arrow-body-style - */ 'arrow-body-style': 'error', - - /** - * https://eslint.org/docs/latest/rules/block-scoped-var - */ 'block-scoped-var': 'error', - - /** - * https://eslint.org/docs/latest/rules/camelcase - */ camelcase: ['error', { allow: allowedProperties }], - - /** - * https://eslint.org/docs/latest/rules/capitalized-comments - */ 'capitalized-comments': [ 'error', 'always', @@ -37,419 +15,83 @@ module.exports = { ignorePattern: /^\s*(c8|type-coverage:|webpack\w)/.source } ], - - /** - * https://eslint.org/docs/latest/rules/class-methods-use-this - */ 'class-methods-use-this': 'error', - - /** - * https://eslint.org/docs/latest/rules/complexity - * - * Use proper judgement in code review. - */ complexity: 'off', - - /** - * https://eslint.org/docs/latest/rules/consistent-return - */ 'consistent-return': 'off', - - /** - * https://eslint.org/docs/latest/rules/consistent-this - */ 'consistent-this': 'error', - - /** - * https://eslint.org/docs/latest/rules/curly - */ curly: 'error', - - /** - * https://eslint.org/docs/latest/rules/default-case - */ 'default-case': 'error', - - /** - * https://eslint.org/docs/latest/rules/default-case-last - */ 'default-case-last': 'error', - - /** - * https://eslint.org/docs/latest/rules/default-param-last - */ 'default-param-last': 'error', - - /** - * https://eslint.org/docs/latest/rules/dot-notation - */ 'dot-notation': 'error', - - /** - * https://eslint.org/docs/latest/rules/eqeqeq - */ eqeqeq: ['error', 'always', { null: 'never' }], - - /** - * https://eslint.org/docs/latest/rules/func-name-matching - * - * Handled by func-style. - */ 'func-name-matching': 'off', - - /** - * https://eslint.org/docs/latest/rules/func-names - */ 'func-names': 'error', - - /** - * https://eslint.org/docs/latest/rules/func-style - */ 'func-style': ['error', 'declaration', { allowArrowFunctions: true }], - - /** - * https://eslint.org/docs/latest/rules/grouped-accessor-pairs - */ 'grouped-accessor-pairs': ['error', 'getBeforeSet'], - - /** - * https://eslint.org/docs/latest/rules/guard-for-in - */ 'guard-for-in': 'error', - - /** - * https://eslint.org/docs/latest/rules/id-denylist - */ 'id-denylist': ['error', 'l', 'O', 'React'], - - /** - * https://eslint.org/docs/latest/rules/id-length - */ 'id-length': 'off', - - /** - * https://eslint.org/docs/latest/rules/id-match - * - * Handled by camelcase - */ 'id-match': 'off', - - /** - * https://eslint.org/docs/latest/rules/init-declarations - */ 'init-declarations': 'off', - - /** - * https://eslint.org/docs/latest/rules/logical-assignment-operators - * - * Not supported in Node.js 14. - */ 'logical-assignment-operators': ['off', 'always', { enforceForIfStatements: true }], - - /** - * https://eslint.org/docs/latest/rules/max-classes-per-file - */ 'max-classes-per-file': 'off', - - /** - * https://eslint.org/docs/latest/rules/max-depth - */ 'max-depth': 'off', - - /** - * https://eslint.org/docs/latest/rules/max-lines - */ 'max-lines': 'off', - - /** - * https://eslint.org/docs/latest/rules/max-lines-per-function - */ 'max-lines-per-function': 'off', - - /** - * https://eslint.org/docs/latest/rules/max-nested-callbacks - */ 'max-nested-callbacks': 'off', - - /** - * https://eslint.org/docs/latest/rules/max-params - */ 'max-params': 'off', - - /** - * https://eslint.org/docs/latest/rules/max-statements - */ 'max-statements': 'off', - - /** - * https://eslint.org/docs/latest/rules/multiline-comment-style - * - * Although starred-block is preferred over bare-block, separate-lins is sometimes acceptable. - */ 'multiline-comment-style': 'off', - - /** - * https://eslint.org/docs/latest/rules/new-cap - */ 'new-cap': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-alert - */ 'no-alert': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-array-constructor - */ 'no-array-constructor': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-bitwise - */ 'no-bitwise': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-caller - */ 'no-caller': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-case-declarations - */ 'no-case-declarations': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-confusing-arrow - * - * Has conflicts with prettier. - */ 'no-confusing-arrow': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-console - */ 'no-console': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-continue - */ 'no-continue': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-delete-var - */ 'no-delete-var': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-div-regex - */ 'no-div-regex': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-else-return - */ 'no-else-return': ['error', { allowElseIf: false }], - - /** - * https://eslint.org/docs/latest/rules/no-empty - */ 'no-empty': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-empty-function - */ 'no-empty-function': 'error', - - /** - * https://eslint.org/docs/latest/rules/empty-static-block - */ 'no-empty-static-block': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-eq-null - */ 'no-eq-null': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-eval - */ 'no-eval': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-extend-native - */ 'no-extend-native': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-extra-boolean-cast - */ 'no-extra-boolean-cast': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-extra-bind - */ 'no-extra-bind': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-extra-label - */ 'no-extra-label': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-extra-semi - * - * Prettier - */ 'no-extra-semi': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-floating-decimal - * - * Prettier - */ 'no-floating-decimal': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-global-assign - */ 'no-global-assign': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-implicit-coercion - */ 'no-implicit-coercion': ['error', { disallowTemplateShorthand: true }], - - /** - * https://eslint.org/docs/latest/rules/no-implicit-globals - */ 'no-implicit-globals': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-implied-eval - */ 'no-implied-eval': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-inline-comments - */ 'no-inline-comments': ['error', { ignorePattern: /\s@type\s/.source }], - - /** - * https://eslint.org/docs/latest/rules/no-invalid-this - */ 'no-invalid-this': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-iterator - */ 'no-iterator': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-label-var - */ 'no-label-var': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-labels - */ 'no-labels': ['error', { allowLoop: true }], - - /** - * https://eslint.org/docs/latest/rules/no-lone-blocks - */ 'no-lone-blocks': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-lonely-if - * - * Handled by `unicorn/no-lonely-if` - */ 'no-lonely-if': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-loop-func - */ 'no-loop-func': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-magic-numbers - */ 'no-magic-numbers': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-mixed-operators - */ 'no-mixed-operators': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-multi-assign - */ 'no-multi-assign': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-multi-str - */ 'no-multi-str': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-negated-condition - * - * Handled by `unicorn/no-negated-condition`. - */ 'no-negated-condition': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-nested-ternary - */ 'no-nested-ternary': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-new - */ 'no-new': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-new-func - */ 'no-new-func': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-new-object - */ 'no-new-object': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-new-wrappers - */ 'no-new-wrappers': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape - * - * Prettier - */ 'no-nonoctal-decimal-escape': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-object-constructor - */ 'no-object-constructor': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-octal - * - * This is useful for limited use cases. - */ 'no-octal': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-octal-escape - */ 'no-octal-escape': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-param-reassign - */ 'no-param-reassign': [ 'error', { @@ -458,40 +100,12 @@ module.exports = { ignorePropertyModificationsFor: ['ctx'] } ], - - /** - * https://eslint.org/docs/latest/rules/no-plusplus - */ 'no-plusplus': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-proto - */ 'no-proto': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-redeclare - */ 'no-redeclare': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-regex-spaces - */ 'no-regex-spaces': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-restricted-exports - */ 'no-restricted-exports': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-restricted-globals - */ 'no-restricted-globals': ['error', ...confusingBrowserGlobals.filter((name) => name !== 'self')], - - /** - * https://eslint.org/docs/latest/rules/no-restricted-imports - */ 'no-restricted-imports': [ 'error', { name: 'node:assert', message: 'Use node:assert/strict instead.' }, @@ -509,15 +123,7 @@ module.exports = { message: 'Use node:timers/promises instead.' } ], - - /** - * https://eslint.org/docs/latest/rules/no-restricted-properties - */ 'no-restricted-properties': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-restricted-syntax - */ 'no-restricted-syntax': [ 'error', { @@ -531,172 +137,38 @@ module.exports = { message: 'Use undefined for non-returning functions of unknown for callbacks' } ], - - /** - * https://eslint.org/docs/latest/rules/no-return-assign - */ 'no-return-assign': ['error', 'always'], - - /** - * https://eslint.org/docs/latest/rules/no-return-await - */ 'no-return-await': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-script-url - */ 'no-script-url': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-sequences - */ 'no-sequences': ['error', { allowInParentheses: false }], - - /** - * https://eslint.org/docs/latest/rules/no-shadow - */ 'no-shadow': ['error', { hoist: 'all' }], - - /** - * https://eslint.org/docs/latest/rules/no-shadow-restricted-names - */ 'no-shadow-restricted-names': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-ternary - */ 'no-ternary': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-throw-literal - */ 'no-throw-literal': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-undef-init - */ 'no-undef-init': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-undefined - */ 'no-undefined': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-underscore-dangle - */ 'no-underscore-dangle': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-unneeded-ternary - */ 'no-unneeded-ternary': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-unused-expressions - */ 'no-unused-expressions': ['error', { enforceForJSX: true }], - - /** - * https://eslint.org/docs/latest/rules/no-unused-labels - */ 'no-unused-labels': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-useless-call - */ 'no-useless-call': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-useless-catch - */ 'no-useless-catch': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-useless-computed-key - */ 'no-useless-computed-key': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-useless-concat - */ 'no-useless-concat': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-useless-constructor - */ 'no-useless-constructor': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-useless-escape - */ 'no-useless-escape': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-useless-rename - */ 'no-useless-rename': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-useless-return - */ 'no-useless-return': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-var - */ 'no-var': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-void - */ 'no-void': 'error', - - /** - * https://eslint.org/docs/latest/rules/no-warning-comments - */ 'no-warning-comments': 'off', - - /** - * https://eslint.org/docs/latest/rules/no-with - */ 'no-with': 'error', - - /** - * https://eslint.org/docs/latest/rules/object-shorthand - */ 'object-shorthand': ['error', 'always', { avoidExplicitReturnArrows: true }], - - /** - * https://eslint.org/docs/latest/rules/one-var - */ 'one-var': ['error', 'never'], - - /** - * https://eslint.org/docs/latest/rules/one-var-declaration-per-line - * - * Prettier - */ 'one-var-declaration-per-line': 'off', - - /** - * https://eslint.org/docs/latest/rules/operator-assignment - */ 'operator-assignment': 'error', - - /** - * https://eslint.org/docs/latest/rules/prefer-arrow-callback - */ 'prefer-arrow-callback': ['error', { allowUnboundThis: false }], - - /** - * https://eslint.org/docs/latest/rules/prefer-const - */ 'prefer-const': ['error', { destructuring: 'all', ignoreReadBeforeAssign: true }], - - /** - * https://eslint.org/docs/latest/rules/prefer-destructuring - */ 'prefer-destructuring': [ 'error', { @@ -704,125 +176,27 @@ module.exports = { AssignmentExpression: { array: false, object: false } } ], - - /** - * https://eslint.org/docs/latest/rules/prefer-exponentiation-operator - */ 'prefer-exponentiation-operator': 'error', - - /** - * https://eslint.org/docs/latest/rules/prefer-named-capture-group - */ 'prefer-named-capture-group': 'off', - - /** - * https://eslint.org/docs/latest/rules/prefer-numeric-literals - */ 'prefer-numeric-literals': 'error', - - /** - * https://eslint.org/docs/latest/rules/prefer-object-has-own - * - * Not yet supported by Safari. - */ 'prefer-object-has-own': 'off', - - /** - * https://eslint.org/docs/latest/rules/prefer-object-spread - */ 'prefer-object-spread': 'error', - - /** - * https://eslint.org/docs/latest/rules/prefer-promise-reject-errors - */ 'prefer-promise-reject-errors': 'error', - - /** - * https://eslint.org/docs/latest/rules/prefer-regex-literals - */ 'prefer-regex-literals': 'error', - - /** - * https://eslint.org/docs/latest/rules/prefer-rest-params - */ 'prefer-rest-params': 'error', - - /** - * https://eslint.org/docs/latest/rules/prefer-spread - */ 'prefer-spread': 'error', - - /** - * https://eslint.org/docs/latest/rules/prefer-template - */ 'prefer-template': 'error', - - /** - * https://eslint.org/docs/latest/rules/quote-props - * - * Prettier - */ 'quote-props': 'off', - - /** - * https://eslint.org/docs/latest/rules/radix - */ radix: ['error', 'as-needed'], - - /** - * https://eslint.org/docs/latest/rules/require-await - */ 'require-await': 'error', - - /** - * https://eslint.org/docs/latest/rules/require-unicode-regexp - */ 'require-unicode-regexp': 'off', - - /** - * https://eslint.org/docs/latest/rules/require-yield - */ 'require-yield': 'error', - - /** - * https://eslint.org/docs/latest/rules/sort-imports - */ 'sort-imports': ['error', { ignoreCase: true, ignoreDeclarationSort: true }], - - /** - * https://eslint.org/docs/latest/rules/sort-keys - */ 'sort-keys': 'off', - - /** - * https://eslint.org/docs/latest/rules/sort-vars - * - * Handled by one-var. - */ 'sort-vars': 'off', - - /** - * https://eslint.org/docs/latest/rules/spaced-comment - */ 'spaced-comment': ['error', 'always', { block: { balanced: true } }], - - /** - * https://eslint.org/docs/latest/rules/strict - */ strict: 'error', - - /** - * https://eslint.org/docs/latest/rules/symbol-description - */ 'symbol-description': 'error', - - /** - * https://eslint.org/docs/latest/rules/vars-on-top - */ 'vars-on-top': 'off', - - /** - * https://eslint.org/docs/latest/rules/yoda - */ yoda: 'error' } diff --git a/dev.js b/dev.js index d9faf3c..53e37ce 100644 --- a/dev.js +++ b/dev.js @@ -1,11 +1,5 @@ -/** - * Allow the usage of dev dependencies and unpublished files. - */ module.exports = { rules: { - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md - */ 'import/no-extraneous-dependencies': [ 'error', { @@ -15,29 +9,9 @@ module.exports = { bundledDependencies: true } ], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/master/.README/rules/require-jsdoc.md - * - * JSDoc is often not relevant in test or configuration files. - */ 'jsdoc/require-jsdoc': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-require.md - */ 'n/no-unpublished-import': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-require.md - */ 'n/no-unpublished-require': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md - * - * This is an optimization that’s not important for tests or confiurations. - */ 'unicorn/consistent-function-scoping': 'off' } } diff --git a/dts.js b/dts.js index eeba211..9a40279 100644 --- a/dts.js +++ b/dts.js @@ -1,31 +1,11 @@ -/** - * A special configuration for the TypeScript ambient context files. - */ module.exports = { rules: { - /** - * https://eslint.org/docs/latest/rules/spaced-comment - * - * Allow triple slash directives for types references. - */ 'spaced-comment': ['error', 'always', { line: { markers: ['/'] } }], - - /** - * https://typescript-eslint.io/rules/triple-slash-reference.md - */ '@typescript-eslint/triple-slash-reference': [ 'error', { lib: 'never', path: 'never', types: 'prefer-import' } ], - - /** - * https://eslint.org/docs/latest/rules/max-classes-per-file - */ 'max-classes-per-file': 'off', - - /** - * https://typescript-eslint.io/rules/no-extraneous-class - */ '@typescript-eslint/no-extraneous-class': 'off' } } diff --git a/plugins/eslint-comments.js b/plugins/eslint-comments.js index 77c9a05..4cc86f9 100644 --- a/plugins/eslint-comments.js +++ b/plugins/eslint-comments.js @@ -1,51 +1,13 @@ -/** - * https://weiran-zsd.github.io/eslint-plugin-eslint-comments - */ module.exports = { rules: { - /** - * https://weiran-zsd.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html - */ 'eslint-comments/disable-enable-pair': 'error', - - /** - * https://weiran-zsd.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html - */ 'eslint-comments/no-aggregating-enable': 'error', - - /** - * https://weiran-zsd.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html - */ 'eslint-comments/no-duplicate-disable': 'error', - - /** - * https://weiran-zsd.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html - */ 'eslint-comments/no-restricted-disable': 'off', - - /** - * https://weiran-zsd.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html - */ 'eslint-comments/no-unlimited-disable': 'error', - - /** - * https://weiran-zsd.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html - */ 'eslint-comments/no-unused-disable': 'error', - - /** - * https://weiran-zsd.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html - */ 'eslint-comments/no-unused-enable': 'error', - - /** - * https://weiran-zsd.github.io/eslint-plugin-eslint-comments/rules/no-use.html - */ 'eslint-comments/no-use': ['error', { allow: ['eslint-disable-next-line'] }], - - /** - * https://weiran-zsd.github.io/eslint-plugin-eslint-comments/rules/require-description.html - */ 'eslint-comments/require-description': 'off' } } diff --git a/plugins/import.js b/plugins/import.js index ebef9c0..33a54f5 100644 --- a/plugins/import.js +++ b/plugins/import.js @@ -1,6 +1,3 @@ -/** - * https://github.com/benmosher/eslint-plugin-import - */ module.exports = { settings: { 'import/extensions': [], @@ -14,86 +11,21 @@ module.exports = { } }, rules: { - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md - */ 'import/consistent-type-specifier-style': ['error', 'prefer-inline'], - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/default.md - */ 'import/default': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/dynamic-import-chunkname.md - */ 'import/dynamic-import-chunkname': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/export.md - */ 'import/export': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/exports-last.md - */ 'import/exports-last': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/extensions.md - */ 'import/extensions': ['error', 'ignorePackages'], - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/first.md - */ 'import/first': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/group-exports.md - */ 'import/group-exports': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/imports-first.md - * - * @deprecated - */ 'import/imports-first': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/max-dependencies.md - */ 'import/max-dependencies': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/named.md - */ 'import/named': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/namespace.md - */ 'import/namespace': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md - */ 'import/newline-after-import': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md - */ 'import/no-absolute-path': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-amd.md - */ 'import/no-amd': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-anonymous-default-export.md - */ 'import/no-anonymous-default-export': [ 'error', { @@ -107,51 +39,13 @@ module.exports = { allowObject: true } ], - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md - */ 'import/no-commonjs': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-cycle.md - */ 'import/no-cycle': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-default-export.md - */ 'import/no-default-export': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md - * - * A package version bump may introduce newly deprecated imports, but it may not always be - * desirable to fix them immediately. For this reason imports of deprecated members are marked - * as a warning, not an error. - */ 'import/no-deprecated': 'warn', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md - */ 'import/no-duplicates': ['error', { 'prefer-inline': true }], - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-dynamic-require.md - */ 'import/no-dynamic-require': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-empty-named-blocks.md - * - * Already checked by `unicorn/import-style` - */ 'import/no-empty-named-blocks': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md - */ 'import/no-extraneous-dependencies': [ 'error', { @@ -161,80 +55,20 @@ module.exports = { bundledDependencies: true } ], - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-import-module-exports.md - */ 'import/no-import-module-exports': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-internal-modules.md - */ 'import/no-internal-modules': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md - */ 'import/no-mutable-exports': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-named-as-default.md - */ 'import/no-named-as-default': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-named-as-default-member.md - */ 'import/no-named-as-default-member': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-named-default.md - */ 'import/no-named-default': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-named-export.md - */ 'import/no-named-export': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-namespace.md - */ 'import/no-namespace': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md - */ 'import/no-nodejs-modules': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md - */ 'import/no-relative-packages': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-relative-parent-imports.md - */ 'import/no-relative-parent-imports': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md - */ 'import/no-restricted-paths': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-self-import.md - */ 'import/no-self-import': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-unassigned-import.md - */ 'import/no-unassigned-import': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md - */ 'import/no-unresolved': [ 'error', { @@ -243,27 +77,9 @@ module.exports = { ignore: [/^[@a-z]/.source, /[!*]/.source, /.\.(cjs|js|mjs)$/.source] } ], - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md - */ 'import/no-unused-modules': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md - */ 'import/no-useless-path-segments': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/no-webpack-loader-syntax.md - */ 'import/no-webpack-loader-syntax': 'error', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/order.md - * - * This is included for files using require syntax. - */ 'import/order': [ 'error', { @@ -277,15 +93,7 @@ module.exports = { warnOnUnassignedImports: true } ], - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/prefer-default-export.md - */ 'import/prefer-default-export': 'off', - - /** - * https://github.com/benmosher/eslint-plugin-import/blob/main/docs/rules/unambiguous.md - */ 'import/unambiguous': 'off' } } diff --git a/plugins/jest-formatting.js b/plugins/jest-formatting.js index 195901d..ff9dbbb 100644 --- a/plugins/jest-formatting.js +++ b/plugins/jest-formatting.js @@ -1,43 +1,12 @@ module.exports = { rules: { - /** - * https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-after-all-blocks.md - */ 'jest-formatting/padding-around-after-all-blocks': 'error', - - /** - * https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-after-each-blocks.md - */ 'jest-formatting/padding-around-after-each-blocks': 'error', - - /** - * https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-all.md - */ 'jest-formatting/padding-around-all': 'off', - - /** - * https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-before-all-blocks.md - */ 'jest-formatting/padding-around-before-all-blocks': 'error', - - /** - * https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-before-each-blocks.md - */ 'jest-formatting/padding-around-before-each-blocks': 'error', - - /** - * https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-describe-blocks.md - */ 'jest-formatting/padding-around-describe-blocks': 'error', - - /** - * https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-expect-groups.md - */ 'jest-formatting/padding-around-expect-groups': 'off', - - /** - * https://github.com/dangreenisrael/eslint-plugin-jest-formatting/blob/master/docs/rules/padding-around-test-blocks.md - */ 'jest-formatting/padding-around-test-blocks': 'error' } } diff --git a/plugins/jsdoc.js b/plugins/jsdoc.js index 20b72c3..61769ec 100644 --- a/plugins/jsdoc.js +++ b/plugins/jsdoc.js @@ -4,9 +4,6 @@ const NON_COMPONENT_FUNCTION = 'FunctionDeclaration[id.name=/^[a-z]/]' const METHOD_DEFINITION = 'MethodDefinition' -/** - * https://github.com/gajus/eslint-plugin-jsdoc - */ module.exports = { settings: { jsdoc: { @@ -68,99 +65,28 @@ module.exports = { } }, rules: { - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-access.md - */ 'jsdoc/check-access': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-alignment.md - * - * Prettier. - */ 'jsdoc/check-alignment': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-examples.md - * - * @see https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v37.0.0 - */ 'jsdoc/check-examples': [ 'off', { exampleCodeRegex: /```(?:js|jsx|javascript|ts|tsx|typescript)\r?\n([\S\s]*)```/.source } ], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-indentation.md - */ 'jsdoc/check-indentation': [ 'error', { excludeTags: ['example', 'param', 'returns', 'throws', 'todo'] } ], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-line-alignment.md - */ 'jsdoc/check-line-alignment': ['error', 'never', { wrapIndent: ' ' }], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-param-names.md - */ 'jsdoc/check-param-names': ['error', { checkDestructured: false }], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-property-names.md - */ 'jsdoc/check-property-names': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-syntax.md - */ 'jsdoc/check-syntax': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-tag-names.md - */ 'jsdoc/check-tag-names': ['error', { jsxTags: true }], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-types.md - */ 'jsdoc/check-types': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-values.md - */ 'jsdoc/check-values': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/empty-tags.md - */ 'jsdoc/empty-tags': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/imports-as-dependencies.md - */ 'jsdoc/imports-as-dependencies': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/implements-on-classes.md - */ 'jsdoc/implements-on-classes': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/informative-docs.md - */ 'jsdoc/informative-docs': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/match-description.md - */ 'jsdoc/match-description': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/match-name.md - */ 'jsdoc/match-name': [ 'error', { @@ -173,10 +99,6 @@ module.exports = { ] } ], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/multiline-blocks.md - */ 'jsdoc/multiline-blocks': [ 'error', { @@ -185,40 +107,12 @@ module.exports = { singleLineTags: ['jsx', 'jsxFrag', 'jsxImportSource', 'jsxRuntime', 'type'] } ], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-blank-block-descriptions.md - */ 'jsdoc/no-blank-block-descriptions': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-blank-blocks.md - */ 'jsdoc/no-blank-blocks': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-bad-blocks.md - */ 'jsdoc/no-bad-blocks': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-defaults.md - */ 'jsdoc/no-defaults': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-missing-syntax.md - */ 'jsdoc/no-missing-syntax': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-multi-asterisks.md - */ 'jsdoc/no-multi-asterisks': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-restricted-syntax.md - */ 'jsdoc/no-restricted-syntax': [ 'error', { @@ -230,50 +124,14 @@ module.exports = { ] } ], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-types.md - */ 'jsdoc/no-types': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-undefined-types.md - */ 'jsdoc/no-undefined-types': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-asterisk-prefix.md - */ 'jsdoc/require-asterisk-prefix': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-description.md - */ 'jsdoc/require-description': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-description-complete-sentence.md - */ 'jsdoc/require-description-complete-sentence': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-example.md - */ 'jsdoc/require-example': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-file-overview.md - */ 'jsdoc/require-file-overview': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-hyphen-before-param-description.md - */ 'jsdoc/require-hyphen-before-param-description': ['error', 'never'], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-jsdoc.md - */ 'jsdoc/require-jsdoc': [ 'error', { @@ -285,10 +143,6 @@ module.exports = { ] } ], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md - */ 'jsdoc/require-param': [ 'error', { @@ -298,95 +152,23 @@ module.exports = { unnamedRootBase: ['arg'] } ], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-description.md - */ 'jsdoc/require-param-description': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-name.md - */ 'jsdoc/require-param-name': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-type.md - */ 'jsdoc/require-param-type': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property.md - */ 'jsdoc/require-property': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-description.md - */ 'jsdoc/require-property-description': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-name.md - */ 'jsdoc/require-property-name': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-type.md - */ 'jsdoc/require-property-type': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns.md - */ 'jsdoc/require-returns': ['error', { contexts: [METHOD_DEFINITION, NON_COMPONENT_FUNCTION] }], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-check.md - */ 'jsdoc/require-returns-check': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-description.md - */ 'jsdoc/require-returns-description': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-type.md - */ 'jsdoc/require-returns-type': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws.md - */ 'jsdoc/require-throws': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields.md - */ 'jsdoc/require-yields': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-check.md - */ 'jsdoc/require-yields-check': 'error', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/sort-tags.md - */ 'jsdoc/sort-tags': ['error', { alphabetizeExtras: true }], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/tag-lines.md - */ 'jsdoc/tag-lines': ['error', 'never', { applyToEndTag: false, startLines: 1, endLines: 0 }], - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/text-escaping.md - */ 'jsdoc/text-escaping': 'off', - - /** - * https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/valid-types.md - */ 'jsdoc/valid-types': 'error' } } diff --git a/plugins/n.js b/plugins/n.js index 99df33d..b7906fa 100644 --- a/plugins/n.js +++ b/plugins/n.js @@ -1,8 +1,5 @@ const { typesOnlyPackages } = require('../utils/constants.js') -/** - * https://github.com/eslint-community/eslint-plugin-n - */ module.exports = { settings: { node: { @@ -11,213 +8,44 @@ module.exports = { } }, rules: { - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/callback-return.md - */ 'n/callback-return': ['error', ['callback', 'cb']], - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/exports-style.md - */ 'n/exports-style': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/file-extension-in-import.md - * - * Handled by import/extensions - */ 'n/file-extension-in-import': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/global-require.md - */ 'n/global-require': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/handle-callback-err.md - */ 'n/handle-callback-err': ['error', /^(err\w*|\w*Error)$/.source], - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-callback-literal.md - */ 'n/no-callback-literal': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-deprecated-api.md - */ 'n/no-deprecated-api': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-exports-assign.md - * - * Handled by node/exports-style - */ 'n/no-exports-assign': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-import.md - */ 'n/no-extraneous-import': ['error', { allowModules: typesOnlyPackages }], - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-require.md - * - * Handled by node/exports-style - */ 'n/no-extraneous-require': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-hide-core-modules.md - * - * @deprecated - */ 'n/no-hide-core-modules': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-import.md - * - * Handled by import/no-unresolved - */ 'n/no-missing-import': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-require.md - * - * Handled by import/no-unresolved - */ 'n/no-missing-require': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-mixed-requires.md - */ 'n/no-mixed-requires': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-new-require.md - */ 'n/no-new-require': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-path-concat.md - */ 'n/no-path-concat': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-env.md - */ 'n/no-process-env': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-exit.md - */ 'n/no-process-exit': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-import.md - */ 'n/no-restricted-import': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-require.md - */ 'n/no-restricted-require': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-sync.md - */ 'n/no-sync': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-bin.md - */ 'n/no-unpublished-bin': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-import.md - */ 'n/no-unpublished-import': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unpublished-require.md - */ 'n/no-unpublished-require': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features.md - * - * @deprecated - */ 'n/no-unsupported-features': 'off', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-builtins.md - */ 'n/no-unsupported-features/es-builtins': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-syntax.md - */ 'n/no-unsupported-features/es-syntax': ['error', { ignores: ['modules'] }], - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/node-builtins.md - */ 'n/no-unsupported-features/node-builtins': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/buffer.md - */ 'n/prefer-global/buffer': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/console.md - */ 'n/prefer-global/console': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/process.md - */ 'n/prefer-global/process': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/text-decoder.md - */ 'n/prefer-global/text-decoder': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/text-encoder.md - */ 'n/prefer-global/text-encoder': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/url.md - */ 'n/prefer-global/url': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-global/url-search-params.md - */ 'n/prefer-global/url-search-params': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-promises/dns.md - */ 'n/prefer-promises/dns': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/prefer-promises/fs.md - */ 'n/prefer-promises/fs': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/process-exit-as-throw.md - */ 'n/process-exit-as-throw': 'error', - - /** - * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/shebang.md - */ 'n/shebang': 'error' } } diff --git a/plugins/prettier.js b/plugins/prettier.js index b68ad2f..36f707b 100644 --- a/plugins/prettier.js +++ b/plugins/prettier.js @@ -1,6 +1,3 @@ -/** - * https://github.com/prettier/eslint-plugin-prettier - */ module.exports = { rules: { 'prettier/prettier': 'error' diff --git a/plugins/sort-destructure-keys.js b/plugins/sort-destructure-keys.js index aa96687..db29aa6 100644 --- a/plugins/sort-destructure-keys.js +++ b/plugins/sort-destructure-keys.js @@ -1,6 +1,3 @@ -/** - * https://github.com/mthadley/eslint-plugin-sort-destructure-keys - */ module.exports = { rules: { 'sort-destructure-keys/sort-destructure-keys': 'error' diff --git a/plugins/unicorn.js b/plugins/unicorn.js index 0743da8..6e862fb 100644 --- a/plugins/unicorn.js +++ b/plugins/unicorn.js @@ -1,75 +1,17 @@ -/** - * https://github.com/sindresorhus/eslint-plugin-unicorn - */ module.exports = { rules: { - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md - */ 'unicorn/better-regex': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md - */ 'unicorn/catch-error-name': ['error', { name: 'error', ignore: ['err', /Error^/] }], - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md - */ 'unicorn/consistent-function-scoping': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-destructuring.md - */ 'unicorn/consistent-destructuring': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/custom-error-definition.md - */ 'unicorn/custom-error-definition': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md - */ 'unicorn/error-message': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/empty-brace-spaces.md - * - * Prettier - */ 'unicorn/empty-brace-spaces': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md - */ 'unicorn/escape-case': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/expiring-todo-comments.md - */ 'unicorn/expiring-todo-comments': ['warn', { allowWarningComments: false }], - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-length-check.md - */ 'unicorn/explicit-length-check': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md - */ 'unicorn/filename-case': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-index.md - * - * @deprecated - */ 'unicorn/import-index': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-style.md - */ 'unicorn/import-style': [ 'error', { @@ -93,628 +35,122 @@ module.exports = { } } ], - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md - */ 'unicorn/new-for-builtins': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md - */ 'unicorn/no-abusive-eslint-disable': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-anonymous-default-export.md - */ 'unicorn/no-anonymous-default-export': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md - */ 'unicorn/no-array-callback-reference': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md - */ 'unicorn/no-array-for-each': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-instanceof.md - * - * @deprecated - */ 'unicorn/no-array-instanceof': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-method-this-argument.md - */ 'unicorn/no-array-method-this-argument': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-push-push.md - */ 'unicorn/no-array-push-push': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md - */ 'unicorn/no-array-reduce': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-expression-member.md - */ 'unicorn/no-await-expression-member': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-in-promise-methods.md - */ 'unicorn/no-await-in-promise-methods': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-console-spaces.md - */ 'unicorn/no-console-spaces': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-document-cookie.md - */ 'unicorn/no-document-cookie': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-empty-file.md - */ 'unicorn/no-empty-file': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-array.md - */ 'unicorn/no-instanceof-array': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-reduce.md - * - * @deprecated - */ 'unicorn/no-reduce': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-static-only-class.md - */ 'unicorn/no-static-only-class': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-this-assignment.md - */ 'unicorn/no-this-assignment': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-typeof-undefined.md - */ 'unicorn/no-typeof-undefined': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-fn-reference-in-iterator.md - * - * @deprecated - */ 'unicorn/no-fn-reference-in-iterator': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md - */ 'unicorn/no-for-loop': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-hex-escape.md - */ 'unicorn/no-hex-escape': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md - */ 'unicorn/no-invalid-remove-event-listener': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-keyword-prefix.md - */ 'unicorn/no-keyword-prefix': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-lonely-if.md - */ 'unicorn/no-lonely-if': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md - */ 'unicorn/no-negated-condition': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-nested-ternary.md - * - * Prettier - */ 'unicorn/no-nested-ternary': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md - */ 'unicorn/no-new-array': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-buffer.md - * - * Handled by node/no-deprecated-api - */ 'unicorn/no-new-buffer': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-null.md - */ 'unicorn/no-null': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-object-as-default-parameter.md - */ 'unicorn/no-object-as-default-parameter': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md - */ 'unicorn/no-process-exit': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-single-promise-in-promise-methods.md - */ 'unicorn/no-single-promise-in-promise-methods': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-thenable.md - */ 'unicorn/no-thenable': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-await.md - */ 'unicorn/no-unnecessary-await': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-polyfills.md - */ 'unicorn/no-unnecessary-polyfills': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md - */ 'unicorn/no-unreadable-iife': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-array-destructuring.md - */ 'unicorn/no-unreadable-array-destructuring': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-regex.md - * - * @deprecated - */ 'unicorn/no-unsafe-regex': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-properties.md - */ 'unicorn/no-unused-properties': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-fallback-in-spread.md - */ 'unicorn/no-useless-fallback-in-spread': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-length-check.md - */ 'unicorn/no-useless-length-check': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md - */ 'unicorn/no-useless-promise-resolve-reject': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-spread.md - */ 'unicorn/no-useless-spread': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md - */ 'unicorn/no-useless-switch-case': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md - */ 'unicorn/no-useless-undefined': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-zero-fractions.md - */ 'unicorn/no-zero-fractions': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md - * - * Prettier - */ 'unicorn/number-literal-case': 'off', - - /** - * hhttps://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md - */ 'unicorn/numeric-separators-style': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md - */ 'unicorn/prefer-add-event-listener': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-find.md - */ 'unicorn/prefer-array-find': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat.md - */ 'unicorn/prefer-array-flat': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-index-of.md - */ 'unicorn/prefer-array-index-of': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat-map.md - */ 'unicorn/prefer-array-flat-map': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-some.md - */ 'unicorn/prefer-array-some': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-at.md - */ 'unicorn/prefer-at': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md - */ 'unicorn/prefer-blob-reading-methods': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-code-point.md - */ 'unicorn/prefer-code-point': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dataset.md - * - * @deprecated - */ 'unicorn/prefer-dataset': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-date-now.md - */ 'unicorn/prefer-date-now': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-default-parameters.md - */ 'unicorn/prefer-default-parameters': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-dataset.md - */ 'unicorn/prefer-dom-node-dataset': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-append.md - */ 'unicorn/prefer-dom-node-append': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-remove.md - */ 'unicorn/prefer-dom-node-remove': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md - */ 'unicorn/prefer-dom-node-text-content': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-export-from.md - */ 'unicorn/prefer-export-from': ['error', { ignoreUsedVariables: true }], - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-event-key.md - * - * @deprecated - */ 'unicorn/prefer-event-key': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-event-target.md - */ 'unicorn/prefer-event-target': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-exponentiation-operator.md - * - * @deprecated - */ 'unicorn/prefer-exponentiation-operator': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-flat-map.md - * - * @deprecated - */ 'unicorn/prefer-flat-map': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md - */ 'unicorn/prefer-includes': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-json-parse-buffer.md - */ 'unicorn/prefer-json-parse-buffer': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-keyboard-event-key.md - */ 'unicorn/prefer-keyboard-event-key': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md - */ 'unicorn/prefer-logical-operator-over-ternary': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-trunc.md - */ 'unicorn/prefer-math-trunc': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-dom-apis.md - */ 'unicorn/prefer-modern-dom-apis': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md - */ 'unicorn/prefer-modern-math-apis': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md - */ 'unicorn/prefer-module': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-native-coercion-functions.md - */ 'unicorn/prefer-native-coercion-functions': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-negative-index.md - */ 'unicorn/prefer-negative-index': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-append.md - * - * @deprecated - */ 'unicorn/prefer-node-append': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-remove.md - * - * @deprecated - */ 'unicorn/prefer-node-remove': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md - */ 'unicorn/prefer-node-protocol': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md - */ 'unicorn/prefer-number-properties': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-from-entries.md - */ 'unicorn/prefer-object-from-entries': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-has-own.md - * - * @deprecated - */ 'unicorn/prefer-object-has-own': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-optional-catch-binding.md - */ 'unicorn/prefer-optional-catch-binding': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-prototype-methods.md - */ 'unicorn/prefer-prototype-methods': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md - */ 'unicorn/prefer-query-selector': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-reflect-apply.md - */ 'unicorn/prefer-reflect-apply': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-test.md - */ 'unicorn/prefer-regexp-test': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-replace-all.md - * - * @deprecated - */ 'unicorn/prefer-replace-all': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-has.md - */ 'unicorn/prefer-set-has': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-size.md - */ 'unicorn/prefer-set-size': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-starts-ends-with.md - * - * @deprecated - */ 'unicorn/prefer-starts-ends-with': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md - */ 'unicorn/prefer-spread': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md - */ 'unicorn/prefer-string-replace-all': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-starts-ends-with.md - */ 'unicorn/prefer-string-starts-ends-with': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-trim-start-end.md - */ 'unicorn/prefer-string-trim-start-end': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md - */ 'unicorn/prefer-string-slice': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-switch.md - */ 'unicorn/prefer-switch': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-ternary.md - */ 'unicorn/prefer-ternary': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-text-content.md - * - * @deprecated - */ 'unicorn/prefer-text-content': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-top-level-await.md - */ 'unicorn/prefer-top-level-await': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-trim-start-end.md - * - * @deprecated - */ 'unicorn/prefer-trim-start-end': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md - */ 'unicorn/prefer-type-error': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md - */ 'unicorn/prevent-abbreviations': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/regex-shorthand.md - * - * @deprecated - */ 'unicorn/regex-shorthand': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/relative-url-style.md - */ 'unicorn/relative-url-style': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md - */ 'unicorn/require-array-join-separator': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-number-to-fixed-digits-argument.md - */ 'unicorn/require-number-to-fixed-digits-argument': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-post-message-target-origin.md - */ 'unicorn/require-post-message-target-origin': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/string-content.md - */ 'unicorn/string-content': 'off', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md - */ 'unicorn/switch-case-braces': ['error', 'avoid'], - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/template-indent.md - */ 'unicorn/template-indent': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md - */ 'unicorn/text-encoding-identifier-case': 'error', - - /** - * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md - */ 'unicorn/throw-new-error': 'error' } } diff --git a/utils/jsx-a11y.js b/utils/jsx-a11y.js index 77eef1e..0135e3a 100644 --- a/utils/jsx-a11y.js +++ b/utils/jsx-a11y.js @@ -1,204 +1,43 @@ module.exports = { rules: { - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/accessible-emoji.md - * - * @deprecated - */ 'jsx-a11y/accessible-emoji': 'off', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/alt-text.md - */ 'jsx-a11y/alt-text': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-ambiguous-text.md - */ 'jsx-a11y/anchor-ambiguous-text': 'off', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-has-content.md - */ 'jsx-a11y/anchor-has-content': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-is-valid.md - */ 'jsx-a11y/anchor-is-valid': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-activedescendant-has-tabindex.md - */ 'jsx-a11y/aria-activedescendant-has-tabindex': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-props.md - */ 'jsx-a11y/aria-props': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-proptypes.md - */ 'jsx-a11y/aria-proptypes': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-role.md - */ 'jsx-a11y/aria-role': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-unsupported-elements.md - */ 'jsx-a11y/aria-unsupported-elements': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/autocomplete-valid.md - */ 'jsx-a11y/autocomplete-valid': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/click-events-have-key-events.md - */ 'jsx-a11y/click-events-have-key-events': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/control-has-associated-label.md - */ 'jsx-a11y/control-has-associated-label': 0, - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/heading-has-content.md - */ 'jsx-a11y/heading-has-content': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/html-has-lang.md - */ 'jsx-a11y/html-has-lang': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/iframe-has-title.md - */ 'jsx-a11y/iframe-has-title': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/img-redundant-alt.md - */ 'jsx-a11y/img-redundant-alt': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/interactive-supports-focus.md - */ 'jsx-a11y/interactive-supports-focus': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-associated-control.md - */ 'jsx-a11y/label-has-associated-control': ['error', { assert: 'either', depth: 25 }], - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-for.md - * - * @deprecated - */ 'jsx-a11y/label-has-for': 'off', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/lang.md - */ 'jsx-a11y/lang': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/media-has-caption.md - */ 'jsx-a11y/media-has-caption': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/mouse-events-have-key-events.md - */ 'jsx-a11y/mouse-events-have-key-events': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-access-key.md - * - * This is often handled using CSS. - */ 'jsx-a11y/no-access-key': 'off', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-aria-hidden-on-focusable.md - */ 'jsx-a11y/no-aria-hidden-on-focusable': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-autofocus.md - */ 'jsx-a11y/no-autofocus': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-distracting-elements.md - */ 'jsx-a11y/no-distracting-elements': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-interactive-element-to-noninteractive-role.md - */ 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-interactions.md - */ 'jsx-a11y/no-noninteractive-element-interactions': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-to-interactive-role.md - */ 'jsx-a11y/no-noninteractive-element-to-interactive-role': 0, - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-tabindex.md - */ 'jsx-a11y/no-noninteractive-tabindex': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-onchange.md - */ 'jsx-a11y/no-onchange': 'off', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-redundant-roles.md - */ 'jsx-a11y/no-redundant-roles': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-static-element-interactions.md - */ 'jsx-a11y/no-static-element-interactions': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/prefer-tag-over-role.md - */ 'jsx-a11y/prefer-tag-over-role': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-has-required-aria-props.md - */ 'jsx-a11y/role-has-required-aria-props': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-supports-aria-props.md - */ 'jsx-a11y/role-supports-aria-props': 'off', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/scope.md - */ 'jsx-a11y/scope': 'error', - - /** - * https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/tabindex-no-positive.md - */ 'jsx-a11y/tabindex-no-positive': 'error' } } diff --git a/utils/react.js b/utils/react.js index d3f2134..5ca960f 100644 --- a/utils/react.js +++ b/utils/react.js @@ -1,108 +1,61 @@ const obsoleteHTMLElements = require('./obsoleteHTMLElements.js') module.exports = { - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/boolean-prop-naming.md - */ 'react/boolean-prop-naming': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/button-has-type.md - */ 'react/button-has-type': { jsx: ['error', { button: true, submit: true, reset: false }], preact: ['error', { button: true, submit: true, reset: false }], react: ['error', { button: true, submit: true, reset: false }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/checked-requires-onchange-or-readonly.md - */ 'react/checked-requires-onchange-or-readonly': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/default-props-match-prop-types.md - */ 'react/default-props-match-prop-types': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md - */ 'react/destructuring-assignment': { jsx: 'off', preact: ['error', 'always', { ignoreClassFields: true }], react: ['error', 'always', { ignoreClassFields: true }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md - */ 'react/display-name': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md - */ 'react/forbid-component-props': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-dom-props.md - */ 'react/forbid-dom-props': { jsx: ['error', { forbid: [{ propName: 'style', message: 'Use a CSS class instead' }] }], preact: ['error', { forbid: [{ propName: 'style', message: 'Use a CSS class instead' }] }], react: ['error', { forbid: [{ propName: 'style', message: 'Use a CSS class instead' }] }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-elements.md - */ 'react/forbid-elements': { jsx: ['error', { forbid: obsoleteHTMLElements }], preact: ['error', { forbid: obsoleteHTMLElements }], react: ['error', { forbid: obsoleteHTMLElements }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md - */ 'react/forbid-foreign-prop-types': { jsx: 'off', preact: 'off', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md - */ 'react/forbid-prop-types': { jsx: 'off', preact: 'off', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md - */ 'react/function-component-definition': { jsx: 'off', preact: [ @@ -114,775 +67,411 @@ module.exports = { { namedComponents: 'function-declaration', unnamedComponents: 'arrow-function' } ] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md - */ 'react/hook-use-state': { jsx: 'off', preact: ['error', { allowDestructuredState: true }], react: ['error', { allowDestructuredState: true }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/iframe-missing-sandbox.md - */ 'react/iframe-missing-sandbox': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md - */ 'react/jsx-boolean-value': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md - * - * Prettier - */ 'react/jsx-child-element-spacing': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md - * - * Prettier - */ 'react/jsx-closing-bracket-location': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md - * - * Prettier - */ 'react/jsx-closing-tag-location': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md - */ 'react/jsx-curly-brace-presence': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md - * - * Prettier - */ 'react/jsx-curly-newline': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md - * - * Prettier - */ 'react/jsx-curly-spacing': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md - * - * Prettier - */ 'react/jsx-equals-spacing': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md - */ 'react/jsx-filename-extension': { jsx: ['error', { allow: 'as-needed', extensions: ['.jsx', '.tsx'] }], preact: ['error', { allow: 'as-needed', extensions: ['.jsx', '.tsx'] }], react: ['error', { allow: 'as-needed', extensions: ['.jsx', '.tsx'] }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md - * - * Prettier - */ 'react/jsx-first-prop-new-line': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md - * - * Fragments are not supported libraries not being React in TypeScript. - */ 'react/jsx-fragments': { jsx: 'off', preact: 'off', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md - */ 'react/jsx-handler-names': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md - * - * Prettier - */ 'react/jsx-indent': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md - * - * Prettier - */ 'react/jsx-indent-props': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md - */ 'react/jsx-key': { jsx: 'off', preact: ['error', { checkFragmentShorthand: true, checkKeyMustBeforeSpread: true }], react: ['error', { checkFragmentShorthand: true, checkKeyMustBeforeSpread: true }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-depth.md - */ 'react/jsx-max-depth': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md - * - * Prettier - */ 'react/jsx-max-props-per-line': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md - */ 'react/jsx-newline': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md - */ 'react/jsx-no-bind': { jsx: 'off', preact: ['error', { allowArrowFunctions: true, ignoreRefs: true }], react: ['error', { allowArrowFunctions: true, ignoreRefs: true }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md - */ 'react/jsx-no-comment-textnodes': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md - */ 'react/jsx-no-constructed-context-values': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md - */ 'react/jsx-no-duplicate-props': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md - */ 'react/jsx-no-literals': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md - */ 'react/jsx-no-leaked-render': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md - */ 'react/jsx-no-script-url': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md - */ 'react/jsx-no-target-blank': { jsx: ['error', { forms: true }], preact: ['error', { forms: true }], react: ['error', { forms: true }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md - */ 'react/jsx-no-undef': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md - */ 'react/jsx-no-useless-fragment': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md - * - * Prettier - */ 'react/jsx-one-expression-per-line': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md - */ 'react/jsx-pascal-case': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md - * - * Prettier - */ 'react/jsx-props-no-multi-spaces': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md - */ 'react/jsx-props-no-spreading': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-default-props.md - * - * @deprecated - */ 'react/jsx-sort-default-props': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md - */ 'react/jsx-sort-props': { jsx: ['error', { ignoreCase: true }], preact: ['error', { ignoreCase: true }], react: ['error', { ignoreCase: true }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-space-before-closing.md - * - * @deprecated - */ 'react/jsx-space-before-closing': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md - * - * Prettier - */ 'react/jsx-tag-spacing': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md - */ 'react/jsx-uses-react': { jsx: 'error', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md - */ 'react/jsx-uses-vars': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md - * - * Prettier - */ 'react/jsx-wrap-multilines': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md - */ 'react/no-access-state-in-setstate': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md - */ 'react/no-adjacent-inline-elements': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md - */ 'react/no-array-index-key': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-arrow-function-lifecycle.md - */ 'react/no-arrow-function-lifecycle': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md - */ 'react/no-children-prop': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md - */ 'react/no-danger': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md - */ 'react/no-danger-with-children': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md - */ 'react/no-deprecated': { jsx: 'off', preact: 'off', react: 'warn' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md - */ 'react/no-did-mount-set-state': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md - */ 'react/no-did-update-set-state': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md - */ 'react/no-direct-mutation-state': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md - */ 'react/no-find-dom-node': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md - */ 'react/no-is-mounted': { jsx: 'off', preact: 'off', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-invalid-html-attribute.md - */ 'react/no-invalid-html-attribute': { jsx: 'off', preact: 'off', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md - * - * Disabled because of https://github.com/yannickcr/eslint-plugin-react/issues/2842 - */ 'react/no-multi-comp': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-namespace.md - */ 'react/no-namespace': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-object-type-as-default-prop.md - */ 'react/no-object-type-as-default-prop': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-redundant-should-component-update.md - */ 'react/no-redundant-should-component-update': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md - */ 'react/no-render-return-value': { jsx: 'off', preact: 'off', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md - */ 'react/no-set-state': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md - */ 'react/no-string-refs': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md - */ 'react/no-this-in-sfc': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-typos.md - */ 'react/no-typos': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md - */ 'react/no-unescaped-entities': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md - */ 'react/no-unknown-property': { jsx: 'off', preact: ['error', { ignore: ['class'] }], react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unsafe.md - */ 'react/no-unsafe': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-class-component-methods.md - */ 'react/no-unused-class-component-methods': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md - */ 'react/no-unused-prop-types': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-state.md - */ 'react/no-unused-state': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md - */ 'react/no-will-update-set-state': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md - */ 'react/prefer-es6-class': { jsx: 'off', preact: 'off', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-exact-props.md - */ 'react/prefer-exact-props': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md - */ 'react/prefer-read-only-props': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md - */ 'react/prefer-stateless-function': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md - */ 'react/prop-types': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md - */ 'react/react-in-jsx-scope': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md - */ 'react/require-default-props': { jsx: 'off', preact: ['error', { forbidDefaultForRequired: true, ignoreFunctionalComponents: true }], react: ['error', { forbidDefaultForRequired: true, ignoreFunctionalComponents: true }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-optimization.md - */ 'react/require-optimization': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md - */ 'react/require-render-return': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md - */ 'react/self-closing-comp': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md - */ 'react/sort-comp': { jsx: 'off', preact: 'error', @@ -902,73 +491,41 @@ module.exports = { } ] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-default-props.md - */ 'react/sort-default-props': { jsx: ['off', { ignoreCase: true }], preact: ['error', { ignoreCase: true }], react: ['error', { ignoreCase: true }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md - */ 'react/sort-prop-types': { jsx: ['off', { ignoreCase: true }], preact: ['error', { ignoreCase: true }], react: ['error', { ignoreCase: true }] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md - */ 'react/state-in-constructor': { jsx: 'off', preact: ['error', 'never'], react: ['error', 'never'] }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md - */ 'react/static-property-placement': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md - */ 'react/style-prop-object': { jsx: 'off', preact: 'off', react: 'off' }, - - /** - * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md - */ 'react/void-dom-elements-no-children': { jsx: 'error', preact: 'error', react: 'error' }, - - /** - * https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks - */ 'react-hooks/rules-of-hooks': { jsx: 'off', preact: 'error', react: 'error' }, - - /** - * https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks - */ 'react-hooks/exhaustive-deps': { jsx: 'off', preact: 'error',