diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2c269d1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: Build + +on: + pull_request: + types: [opened, synchronize] + push: + branches: + - main + - 'renovate/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/pnpm + + - name: Build + run: pnpm run build diff --git a/.github/workflows/bump_oxlint.yml b/.github/workflows/bump_oxlint.yml index ed1679d..0447b3b 100644 --- a/.github/workflows/bump_oxlint.yml +++ b/.github/workflows/bump_oxlint.yml @@ -25,7 +25,6 @@ jobs: pnpm run generate # Generate rules from latest oxlint pnpm run format # run prettier over it pnpm run test -u # Update test snapshots - pnpm run build # build cjs, mjs and d.ts files npm version ${{ inputs.version }} --no-git-tag-version - uses: peter-evans/create-pull-request@v7 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ecf7ee8..05504da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,9 @@ jobs: - uses: ./.github/actions/pnpm + - name: Build + run: pnpm run build + - name: Extract version from commit message run: | VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oP 'release: \Kv[0-9]+\.[0-9]+\.[0-9]+') diff --git a/.prettierignore b/.prettierignore index 0a8eaa6..77fd699 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,3 @@ pnpm-lock.yaml -lib/ +dist/ ~ diff --git a/README.md b/README.md index c927a23..51994ad 100644 --- a/README.md +++ b/README.md @@ -113,12 +113,6 @@ new rules that haven't been released will not be included. pnpm generate ``` -build cjs and esm versions of the library - -```shell -pnpm build -``` - ## License [MIT](https://github.com/Dunqing/eslint-plugin-oxlint/blob/main/LICENSE) diff --git a/eslint.config.ts b/eslint.config.ts index 160d406..9a3ff43 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -11,6 +11,6 @@ export default [ eslintConfigPrettier, oxlint.configs['flat/all'], { - ignores: ['lib/'], + ignores: ['dist/'], }, ]; diff --git a/lib/index.cjs b/lib/index.cjs deleted file mode 100644 index 087e8f2..0000000 --- a/lib/index.cjs +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; -const rulesByScope = require('./rules-by-scope.cjs'); -const rulesByCategory = require('./rules-by-category.cjs'); -const utils = require('./utils.cjs'); -const allRules = Object.assign({}, ...Object.values(rulesByScope)); -const index = { - configs: { - recommended: { - plugins: ['oxlint'], - rules: rulesByCategory.correctnessRules, - }, - all: { - plugins: ['oxlint'], - rules: allRules, - }, - 'flat/all': { - rules: allRules, - }, - 'flat/recommended': { - rules: rulesByCategory.correctnessRules, - }, - ...utils.createFlatRulesConfig(rulesByScope), - ...utils.createFlatRulesConfig(rulesByCategory), - }, -}; -module.exports = index; diff --git a/lib/index.d.ts b/lib/index.d.ts deleted file mode 100644 index 26a249f..0000000 --- a/lib/index.d.ts +++ /dev/null @@ -1,303 +0,0 @@ -declare const _default: { - configs: { - recommended: { - plugins: string[]; - rules: { - 'for-direction': string; - 'no-async-promise-executor': string; - 'no-caller': string; - 'no-class-assign': string; - 'no-compare-neg-zero': string; - 'no-cond-assign': string; - 'no-const-assign': string; - 'no-constant-binary-expression': string; - 'no-constant-condition': string; - 'no-control-regex': string; - 'no-debugger': string; - 'no-delete-var': string; - 'no-dupe-class-members': string; - 'no-dupe-else-if': string; - 'no-dupe-keys': string; - 'no-duplicate-case': string; - 'no-empty-character-class': string; - 'no-empty-pattern': string; - 'no-empty-static-block': string; - 'no-ex-assign': string; - 'no-extra-boolean-cast': string; - 'no-func-assign': string; - 'no-global-assign': string; - 'no-inner-declarations': string; - 'no-irregular-whitespace': string; - 'no-loss-of-precision': string; - 'no-new-symbol': string; - 'no-nonoctal-decimal-escape': string; - 'no-obj-calls': string; - 'no-self-assign': string; - 'no-setter-return': string; - 'no-shadow-restricted-names': string; - 'no-sparse-arrays': string; - 'no-this-before-super': string; - 'no-unsafe-finally': string; - 'no-unsafe-negation': string; - 'no-unused-labels': string; - 'no-unused-private-class-members': string; - 'no-useless-catch': string; - 'no-useless-escape': string; - 'no-useless-rename': string; - 'no-with': string; - 'require-yield': string; - 'use-isnan': string; - 'valid-typeof': string; - 'jest/expect-expect': string; - 'jest/no-conditional-expect': string; - 'jest/no-disabled-tests': string; - 'jest/no-export': string; - 'jest/no-focused-tests': string; - 'jest/no-standalone-expect': string; - 'jest/require-to-throw-message': string; - 'jest/valid-describe-callback': string; - 'jest/valid-expect': string; - 'jest/valid-title': string; - 'jsdoc/check-property-names': string; - 'jsdoc/require-property': string; - 'jsdoc/require-property-description': string; - 'jsdoc/require-property-name': string; - 'jsdoc/require-property-type': string; - 'jsx-a11y/alt-text': string; - 'jsx-a11y/anchor-has-content': string; - 'jsx-a11y/anchor-is-valid': string; - 'jsx-a11y/aria-activedescendant-has-tabindex': string; - 'jsx-a11y/aria-props': string; - 'jsx-a11y/aria-role': string; - 'jsx-a11y/aria-unsupported-elements': string; - 'jsx-a11y/autocomplete-valid': string; - 'jsx-a11y/click-events-have-key-events': string; - 'jsx-a11y/heading-has-content': string; - 'jsx-a11y/html-has-lang': string; - 'jsx-a11y/iframe-has-title': string; - 'jsx-a11y/img-redundant-alt': string; - 'jsx-a11y/lang': string; - 'jsx-a11y/media-has-caption': string; - 'jsx-a11y/mouse-events-have-key-events': string; - 'jsx-a11y/no-access-key': string; - 'jsx-a11y/no-aria-hidden-on-focusable': string; - 'jsx-a11y/no-autofocus': string; - 'jsx-a11y/no-distracting-elements': string; - 'jsx-a11y/no-redundant-roles': string; - 'jsx-a11y/prefer-tag-over-role': string; - 'jsx-a11y/role-has-required-aria-props': string; - 'jsx-a11y/role-supports-aria-props': string; - 'jsx-a11y/scope': string; - 'jsx-a11y/tabindex-no-positive': string; - 'nextjs/google-font-display': string; - 'nextjs/google-font-preconnect': string; - 'nextjs/inline-script-id': string; - 'nextjs/next-script-for-ga': string; - 'nextjs/no-assign-module-variable': string; - 'nextjs/no-async-client-component': string; - 'nextjs/no-before-interactive-script-outside-document': string; - 'nextjs/no-css-tags': string; - 'nextjs/no-document-import-in-page': string; - 'nextjs/no-head-element': string; - 'nextjs/no-head-import-in-document': string; - 'nextjs/no-img-element': string; - 'nextjs/no-script-component-in-head': string; - 'nextjs/no-sync-scripts': string; - 'nextjs/no-title-in-document-head': string; - 'nextjs/no-typos': string; - 'nextjs/no-unwanted-polyfillio': string; - 'react/jsx-key': string; - 'react/jsx-no-duplicate-props': string; - 'react/jsx-no-target-blank': string; - 'react/jsx-no-undef': string; - 'react/jsx-no-useless-fragment': string; - 'react/no-children-prop': string; - 'react/no-direct-mutation-state': string; - 'react/no-find-dom-node': string; - 'react/no-is-mounted': string; - 'react/no-render-return-value': string; - 'react/no-string-refs': string; - 'react/require-render-return': string; - 'react/void-dom-elements-no-children': string; - 'react-perf/jsx-no-jsx-as-prop': string; - 'react-perf/jsx-no-new-array-as-prop': string; - 'react-perf/jsx-no-new-function-as-prop': string; - 'react-perf/jsx-no-new-object-as-prop': string; - '@typescript-eslint/no-extra-non-null-assertion': string; - '@typescript-eslint/no-misused-new': string; - '@typescript-eslint/no-namespace': string; - '@typescript-eslint/no-non-null-asserted-optional-chain': string; - '@typescript-eslint/no-this-alias': string; - '@typescript-eslint/no-unsafe-declaration-merging': string; - '@typescript-eslint/prefer-as-const': string; - '@typescript-eslint/triple-slash-reference': string; - 'unicorn/no-await-in-promise-methods': string; - 'unicorn/no-document-cookie': string; - 'unicorn/no-empty-file': string; - 'unicorn/no-invalid-remove-event-listener': string; - 'unicorn/no-new-array': string; - 'unicorn/no-single-promise-in-promise-methods': string; - 'unicorn/no-thenable': string; - 'unicorn/no-unnecessary-await': string; - 'unicorn/no-useless-fallback-in-spread': string; - 'unicorn/no-useless-length-check': string; - 'unicorn/no-useless-spread': string; - 'unicorn/prefer-set-size': string; - 'unicorn/prefer-string-starts-ends-with': string; - }; - }; - all: { - plugins: string[]; - rules: Record; - }; - 'flat/all': { - rules: Record; - }; - 'flat/recommended': { - rules: { - 'for-direction': string; - 'no-async-promise-executor': string; - 'no-caller': string; - 'no-class-assign': string; - 'no-compare-neg-zero': string; - 'no-cond-assign': string; - 'no-const-assign': string; - 'no-constant-binary-expression': string; - 'no-constant-condition': string; - 'no-control-regex': string; - 'no-debugger': string; - 'no-delete-var': string; - 'no-dupe-class-members': string; - 'no-dupe-else-if': string; - 'no-dupe-keys': string; - 'no-duplicate-case': string; - 'no-empty-character-class': string; - 'no-empty-pattern': string; - 'no-empty-static-block': string; - 'no-ex-assign': string; - 'no-extra-boolean-cast': string; - 'no-func-assign': string; - 'no-global-assign': string; - 'no-inner-declarations': string; - 'no-irregular-whitespace': string; - 'no-loss-of-precision': string; - 'no-new-symbol': string; - 'no-nonoctal-decimal-escape': string; - 'no-obj-calls': string; - 'no-self-assign': string; - 'no-setter-return': string; - 'no-shadow-restricted-names': string; - 'no-sparse-arrays': string; - 'no-this-before-super': string; - 'no-unsafe-finally': string; - 'no-unsafe-negation': string; - 'no-unused-labels': string; - 'no-unused-private-class-members': string; - 'no-useless-catch': string; - 'no-useless-escape': string; - 'no-useless-rename': string; - 'no-with': string; - 'require-yield': string; - 'use-isnan': string; - 'valid-typeof': string; - 'jest/expect-expect': string; - 'jest/no-conditional-expect': string; - 'jest/no-disabled-tests': string; - 'jest/no-export': string; - 'jest/no-focused-tests': string; - 'jest/no-standalone-expect': string; - 'jest/require-to-throw-message': string; - 'jest/valid-describe-callback': string; - 'jest/valid-expect': string; - 'jest/valid-title': string; - 'jsdoc/check-property-names': string; - 'jsdoc/require-property': string; - 'jsdoc/require-property-description': string; - 'jsdoc/require-property-name': string; - 'jsdoc/require-property-type': string; - 'jsx-a11y/alt-text': string; - 'jsx-a11y/anchor-has-content': string; - 'jsx-a11y/anchor-is-valid': string; - 'jsx-a11y/aria-activedescendant-has-tabindex': string; - 'jsx-a11y/aria-props': string; - 'jsx-a11y/aria-role': string; - 'jsx-a11y/aria-unsupported-elements': string; - 'jsx-a11y/autocomplete-valid': string; - 'jsx-a11y/click-events-have-key-events': string; - 'jsx-a11y/heading-has-content': string; - 'jsx-a11y/html-has-lang': string; - 'jsx-a11y/iframe-has-title': string; - 'jsx-a11y/img-redundant-alt': string; - 'jsx-a11y/lang': string; - 'jsx-a11y/media-has-caption': string; - 'jsx-a11y/mouse-events-have-key-events': string; - 'jsx-a11y/no-access-key': string; - 'jsx-a11y/no-aria-hidden-on-focusable': string; - 'jsx-a11y/no-autofocus': string; - 'jsx-a11y/no-distracting-elements': string; - 'jsx-a11y/no-redundant-roles': string; - 'jsx-a11y/prefer-tag-over-role': string; - 'jsx-a11y/role-has-required-aria-props': string; - 'jsx-a11y/role-supports-aria-props': string; - 'jsx-a11y/scope': string; - 'jsx-a11y/tabindex-no-positive': string; - 'nextjs/google-font-display': string; - 'nextjs/google-font-preconnect': string; - 'nextjs/inline-script-id': string; - 'nextjs/next-script-for-ga': string; - 'nextjs/no-assign-module-variable': string; - 'nextjs/no-async-client-component': string; - 'nextjs/no-before-interactive-script-outside-document': string; - 'nextjs/no-css-tags': string; - 'nextjs/no-document-import-in-page': string; - 'nextjs/no-head-element': string; - 'nextjs/no-head-import-in-document': string; - 'nextjs/no-img-element': string; - 'nextjs/no-script-component-in-head': string; - 'nextjs/no-sync-scripts': string; - 'nextjs/no-title-in-document-head': string; - 'nextjs/no-typos': string; - 'nextjs/no-unwanted-polyfillio': string; - 'react/jsx-key': string; - 'react/jsx-no-duplicate-props': string; - 'react/jsx-no-target-blank': string; - 'react/jsx-no-undef': string; - 'react/jsx-no-useless-fragment': string; - 'react/no-children-prop': string; - 'react/no-direct-mutation-state': string; - 'react/no-find-dom-node': string; - 'react/no-is-mounted': string; - 'react/no-render-return-value': string; - 'react/no-string-refs': string; - 'react/require-render-return': string; - 'react/void-dom-elements-no-children': string; - 'react-perf/jsx-no-jsx-as-prop': string; - 'react-perf/jsx-no-new-array-as-prop': string; - 'react-perf/jsx-no-new-function-as-prop': string; - 'react-perf/jsx-no-new-object-as-prop': string; - '@typescript-eslint/no-extra-non-null-assertion': string; - '@typescript-eslint/no-misused-new': string; - '@typescript-eslint/no-namespace': string; - '@typescript-eslint/no-non-null-asserted-optional-chain': string; - '@typescript-eslint/no-this-alias': string; - '@typescript-eslint/no-unsafe-declaration-merging': string; - '@typescript-eslint/prefer-as-const': string; - '@typescript-eslint/triple-slash-reference': string; - 'unicorn/no-await-in-promise-methods': string; - 'unicorn/no-document-cookie': string; - 'unicorn/no-empty-file': string; - 'unicorn/no-invalid-remove-event-listener': string; - 'unicorn/no-new-array': string; - 'unicorn/no-single-promise-in-promise-methods': string; - 'unicorn/no-thenable': string; - 'unicorn/no-unnecessary-await': string; - 'unicorn/no-useless-fallback-in-spread': string; - 'unicorn/no-useless-length-check': string; - 'unicorn/no-useless-spread': string; - 'unicorn/prefer-set-size': string; - 'unicorn/prefer-string-starts-ends-with': string; - }; - }; - }; -}; -export default _default; diff --git a/lib/index.mjs b/lib/index.mjs deleted file mode 100644 index 104fe62..0000000 --- a/lib/index.mjs +++ /dev/null @@ -1,26 +0,0 @@ -import * as rulesByScope from './rules-by-scope.mjs'; -import * as rulesByCategory from './rules-by-category.mjs'; -import { correctnessRules } from './rules-by-category.mjs'; -import { createFlatRulesConfig } from './utils.mjs'; -const allRules = Object.assign({}, ...Object.values(rulesByScope)); -const index = { - configs: { - recommended: { - plugins: ['oxlint'], - rules: correctnessRules, - }, - all: { - plugins: ['oxlint'], - rules: allRules, - }, - 'flat/all': { - rules: allRules, - }, - 'flat/recommended': { - rules: correctnessRules, - }, - ...createFlatRulesConfig(rulesByScope), - ...createFlatRulesConfig(rulesByCategory), - }, -}; -export { index as default }; diff --git a/lib/rules-by-category.cjs b/lib/rules-by-category.cjs deleted file mode 100644 index 6d254fc..0000000 --- a/lib/rules-by-category.cjs +++ /dev/null @@ -1,327 +0,0 @@ -'use strict'; -Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const pedanticRules = { - 'array-callback-return': 'off', - eqeqeq: 'off', - 'max-lines': 'off', - 'no-array-constructor': 'off', - 'no-case-declarations': 'off', - 'no-mixed-operators': 'off', - 'no-new-wrappers': 'off', - 'no-prototype-builtins': 'off', - 'no-redeclare': 'off', - 'no-return-await': 'off', - 'no-self-compare': 'off', - 'react/checked-requires-onchange-or-readonly': 'off', - 'react/no-unescaped-entities': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/ban-types': 'off', - '@typescript-eslint/no-duplicate-enum-values': 'off', - '@typescript-eslint/prefer-ts-expect-error': 'off', - 'unicorn/escape-case': 'off', - 'unicorn/explicit-length-check': 'off', - 'unicorn/new-for-builtins': 'off', - 'unicorn/no-hex-escape': 'off', - 'unicorn/no-instanceof-array': 'off', - 'unicorn/no-lonely-if': 'off', - 'unicorn/no-negated-condition': 'off', - 'unicorn/no-new-buffer': 'off', - 'unicorn/no-object-as-default-parameter': 'off', - 'unicorn/no-static-only-class': 'off', - 'unicorn/no-this-assignment': 'off', - 'unicorn/no-typeof-undefined': 'off', - 'unicorn/no-unreadable-iife': 'off', - 'unicorn/no-useless-promise-resolve-reject': 'off', - 'unicorn/no-useless-switch-case': 'off', - 'unicorn/prefer-array-flat': 'off', - 'unicorn/prefer-array-some': 'off', - 'unicorn/prefer-blob-reading-methods': 'off', - 'unicorn/prefer-code-point': 'off', - 'unicorn/prefer-date-now': 'off', - 'unicorn/prefer-dom-node-append': 'off', - 'unicorn/prefer-dom-node-dataset': 'off', - 'unicorn/prefer-dom-node-remove': 'off', - 'unicorn/prefer-event-target': 'off', - 'unicorn/prefer-math-trunc': 'off', - 'unicorn/prefer-native-coercion-functions': 'off', - 'unicorn/prefer-prototype-methods': 'off', - 'unicorn/prefer-query-selector': 'off', - 'unicorn/prefer-regexp-test': 'off', - 'unicorn/prefer-string-replace-all': 'off', - 'unicorn/prefer-string-slice': 'off', - 'unicorn/prefer-type-error': 'off', - 'unicorn/require-number-to-fixed-digits-argument': 'off', -}; -const nurseryRules = { - 'constructor-super': 'off', - 'getter-return': 'off', - 'no-fallthrough': 'off', - 'no-import-assign': 'off', - 'no-undef': 'off', - 'import/default': 'off', - 'import/export': 'off', - 'import/named': 'off', - 'import/namespace': 'off', - 'import/no-amd': 'off', - 'import/no-cycle': 'off', - 'import/no-default-export': 'off', - 'import/no-deprecated': 'off', - 'import/no-duplicates': 'off', - 'import/no-named-as-default': 'off', - 'import/no-named-as-default-member': 'off', - 'import/no-self-import': 'off', - 'import/no-unused-modules': 'off', - 'tree-shaking/no-side-effects-in-initialization': 'off', -}; -const styleRules = { - 'default-case-last': 'off', - 'default-param-last': 'off', - 'guard-for-in': 'off', - 'max-params': 'off', - 'no-continue': 'off', - 'no-script-url': 'off', - 'no-template-curly-in-string': 'off', - 'no-ternary': 'off', - 'jest/max-expects': 'off', - 'jest/no-alias-methods': 'off', - 'jest/no-confusing-set-timeout': 'off', - 'jest/no-deprecated-functions': 'off', - 'jest/no-done-callback': 'off', - 'jest/no-hooks': 'off', - 'jest/no-identical-title': 'off', - 'jest/no-interpolation-in-snapshots': 'off', - 'jest/no-jasmine-globals': 'off', - 'jest/no-mocks-import': 'off', - 'jest/no-restricted-jest-methods': 'off', - 'jest/no-restricted-matchers': 'off', - 'jest/no-test-prefixes': 'off', - 'jest/no-test-return-statement': 'off', - 'jest/no-untyped-mock-factory': 'off', - 'jest/prefer-called-with': 'off', - 'jest/prefer-comparison-matcher': 'off', - 'jest/prefer-equality-matcher': 'off', - 'jest/prefer-expect-resolves': 'off', - 'jest/prefer-lowercase-title': 'off', - 'jest/prefer-mock-promise-shorthand': 'off', - 'jest/prefer-spy-on': 'off', - 'jest/prefer-strict-equal': 'off', - 'jest/prefer-to-be': 'off', - 'jest/prefer-to-contain': 'off', - 'jest/prefer-to-have-length': 'off', - 'jest/prefer-todo': 'off', - '@typescript-eslint/adjacent-overload-signatures': 'off', - '@typescript-eslint/array-type': 'off', - '@typescript-eslint/ban-tslint-comment': 'off', - '@typescript-eslint/consistent-type-definitions': 'off', - '@typescript-eslint/no-empty-interface': 'off', - '@typescript-eslint/prefer-for-of': 'off', - '@typescript-eslint/prefer-function-type': 'off', - 'unicorn/catch-error-name': 'off', - 'unicorn/empty-brace-spaces': 'off', - 'unicorn/error-message': 'off', - 'unicorn/filename-case': 'off', - 'unicorn/no-await-expression-member': 'off', - 'unicorn/no-console-spaces': 'off', - 'unicorn/no-null': 'off', - 'unicorn/no-unreadable-array-destructuring': 'off', - 'unicorn/no-zero-fractions': 'off', - 'unicorn/number-literal-case': 'off', - 'unicorn/numeric-separators-style': 'off', - 'unicorn/prefer-array-flat-map': 'off', - 'unicorn/prefer-dom-node-text-content': 'off', - 'unicorn/prefer-includes': 'off', - 'unicorn/prefer-logical-operator-over-ternary': 'off', - 'unicorn/prefer-modern-dom-apis': 'off', - 'unicorn/prefer-node-protocol': 'off', - 'unicorn/prefer-optional-catch-binding': 'off', - 'unicorn/prefer-reflect-apply': 'off', - 'unicorn/prefer-spread': 'off', - 'unicorn/prefer-string-trim-start-end': 'off', - 'unicorn/require-array-join-separator': 'off', - 'unicorn/switch-case-braces': 'off', - 'unicorn/text-encoding-identifier-case': 'off', - 'unicorn/throw-new-error': 'off', -}; -const correctnessRules = { - 'for-direction': 'off', - 'no-async-promise-executor': 'off', - 'no-caller': 'off', - 'no-class-assign': 'off', - 'no-compare-neg-zero': 'off', - 'no-cond-assign': 'off', - 'no-const-assign': 'off', - 'no-constant-binary-expression': 'off', - 'no-constant-condition': 'off', - 'no-control-regex': 'off', - 'no-debugger': 'off', - 'no-delete-var': 'off', - 'no-dupe-class-members': 'off', - 'no-dupe-else-if': 'off', - 'no-dupe-keys': 'off', - 'no-duplicate-case': 'off', - 'no-empty-character-class': 'off', - 'no-empty-pattern': 'off', - 'no-empty-static-block': 'off', - 'no-ex-assign': 'off', - 'no-extra-boolean-cast': 'off', - 'no-func-assign': 'off', - 'no-global-assign': 'off', - 'no-inner-declarations': 'off', - 'no-irregular-whitespace': 'off', - 'no-loss-of-precision': 'off', - 'no-new-symbol': 'off', - 'no-nonoctal-decimal-escape': 'off', - 'no-obj-calls': 'off', - 'no-self-assign': 'off', - 'no-setter-return': 'off', - 'no-shadow-restricted-names': 'off', - 'no-sparse-arrays': 'off', - 'no-this-before-super': 'off', - 'no-unsafe-finally': 'off', - 'no-unsafe-negation': 'off', - 'no-unused-labels': 'off', - 'no-unused-private-class-members': 'off', - 'no-useless-catch': 'off', - 'no-useless-escape': 'off', - 'no-useless-rename': 'off', - 'no-with': 'off', - 'require-yield': 'off', - 'use-isnan': 'off', - 'valid-typeof': 'off', - 'jest/expect-expect': 'off', - 'jest/no-conditional-expect': 'off', - 'jest/no-disabled-tests': 'off', - 'jest/no-export': 'off', - 'jest/no-focused-tests': 'off', - 'jest/no-standalone-expect': 'off', - 'jest/require-to-throw-message': 'off', - 'jest/valid-describe-callback': 'off', - 'jest/valid-expect': 'off', - 'jest/valid-title': 'off', - 'jsdoc/check-property-names': 'off', - 'jsdoc/require-property': 'off', - 'jsdoc/require-property-description': 'off', - 'jsdoc/require-property-name': 'off', - 'jsdoc/require-property-type': 'off', - 'jsx-a11y/alt-text': 'off', - 'jsx-a11y/anchor-has-content': 'off', - 'jsx-a11y/anchor-is-valid': 'off', - 'jsx-a11y/aria-activedescendant-has-tabindex': 'off', - 'jsx-a11y/aria-props': 'off', - 'jsx-a11y/aria-role': 'off', - 'jsx-a11y/aria-unsupported-elements': 'off', - 'jsx-a11y/autocomplete-valid': 'off', - 'jsx-a11y/click-events-have-key-events': 'off', - 'jsx-a11y/heading-has-content': 'off', - 'jsx-a11y/html-has-lang': 'off', - 'jsx-a11y/iframe-has-title': 'off', - 'jsx-a11y/img-redundant-alt': 'off', - 'jsx-a11y/lang': 'off', - 'jsx-a11y/media-has-caption': 'off', - 'jsx-a11y/mouse-events-have-key-events': 'off', - 'jsx-a11y/no-access-key': 'off', - 'jsx-a11y/no-aria-hidden-on-focusable': 'off', - 'jsx-a11y/no-autofocus': 'off', - 'jsx-a11y/no-distracting-elements': 'off', - 'jsx-a11y/no-redundant-roles': 'off', - 'jsx-a11y/prefer-tag-over-role': 'off', - 'jsx-a11y/role-has-required-aria-props': 'off', - 'jsx-a11y/role-supports-aria-props': 'off', - 'jsx-a11y/scope': 'off', - 'jsx-a11y/tabindex-no-positive': 'off', - 'nextjs/google-font-display': 'off', - 'nextjs/google-font-preconnect': 'off', - 'nextjs/inline-script-id': 'off', - 'nextjs/next-script-for-ga': 'off', - 'nextjs/no-assign-module-variable': 'off', - 'nextjs/no-async-client-component': 'off', - 'nextjs/no-before-interactive-script-outside-document': 'off', - 'nextjs/no-css-tags': 'off', - 'nextjs/no-document-import-in-page': 'off', - 'nextjs/no-head-element': 'off', - 'nextjs/no-head-import-in-document': 'off', - 'nextjs/no-img-element': 'off', - 'nextjs/no-script-component-in-head': 'off', - 'nextjs/no-sync-scripts': 'off', - 'nextjs/no-title-in-document-head': 'off', - 'nextjs/no-typos': 'off', - 'nextjs/no-unwanted-polyfillio': 'off', - 'react/jsx-key': 'off', - 'react/jsx-no-duplicate-props': 'off', - 'react/jsx-no-target-blank': 'off', - 'react/jsx-no-undef': 'off', - 'react/jsx-no-useless-fragment': 'off', - 'react/no-children-prop': 'off', - 'react/no-direct-mutation-state': 'off', - 'react/no-find-dom-node': 'off', - 'react/no-is-mounted': 'off', - 'react/no-render-return-value': 'off', - 'react/no-string-refs': 'off', - 'react/require-render-return': 'off', - 'react/void-dom-elements-no-children': 'off', - 'react-perf/jsx-no-jsx-as-prop': 'off', - 'react-perf/jsx-no-new-array-as-prop': 'off', - 'react-perf/jsx-no-new-function-as-prop': 'off', - 'react-perf/jsx-no-new-object-as-prop': 'off', - '@typescript-eslint/no-extra-non-null-assertion': 'off', - '@typescript-eslint/no-misused-new': 'off', - '@typescript-eslint/no-namespace': 'off', - '@typescript-eslint/no-non-null-asserted-optional-chain': 'off', - '@typescript-eslint/no-this-alias': 'off', - '@typescript-eslint/no-unsafe-declaration-merging': 'off', - '@typescript-eslint/prefer-as-const': 'off', - '@typescript-eslint/triple-slash-reference': 'off', - 'unicorn/no-await-in-promise-methods': 'off', - 'unicorn/no-document-cookie': 'off', - 'unicorn/no-empty-file': 'off', - 'unicorn/no-invalid-remove-event-listener': 'off', - 'unicorn/no-new-array': 'off', - 'unicorn/no-single-promise-in-promise-methods': 'off', - 'unicorn/no-thenable': 'off', - 'unicorn/no-unnecessary-await': 'off', - 'unicorn/no-useless-fallback-in-spread': 'off', - 'unicorn/no-useless-length-check': 'off', - 'unicorn/no-useless-spread': 'off', - 'unicorn/prefer-set-size': 'off', - 'unicorn/prefer-string-starts-ends-with': 'off', -}; -const restrictionRules = { - 'no-bitwise': 'off', - 'no-console': 'off', - 'no-empty': 'off', - 'no-eq-null': 'off', - 'no-eval': 'off', - 'no-iterator': 'off', - 'no-proto': 'off', - 'no-regex-spaces': 'off', - 'no-unsafe-optional-chaining': 'off', - 'no-var': 'off', - 'no-void': 'off', - 'jsdoc/check-access': 'off', - 'jsdoc/empty-tags': 'off', - 'react/button-has-type': 'off', - 'react/no-danger': 'off', - 'react/no-unknown-property': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-var-requires': 'off', - 'unicorn/no-abusive-eslint-disable': 'off', - 'unicorn/no-array-for-each': 'off', - 'unicorn/no-array-reduce': 'off', - 'unicorn/no-nested-ternary': 'off', - 'unicorn/no-process-exit': 'off', - 'unicorn/prefer-modern-math-apis': 'off', - 'unicorn/prefer-number-properties': 'off', -}; -const suspiciousRules = { - 'jest/no-commented-out-tests': 'off', - 'react/jsx-no-comment-textnodes': 'off', - 'react/react-in-jsx-scope': 'off', - '@typescript-eslint/no-unnecessary-type-constraint': 'off', - 'unicorn/prefer-add-event-listener': 'off', -}; -exports.correctnessRules = correctnessRules; -exports.nurseryRules = nurseryRules; -exports.pedanticRules = pedanticRules; -exports.restrictionRules = restrictionRules; -exports.styleRules = styleRules; -exports.suspiciousRules = suspiciousRules; diff --git a/lib/rules-by-category.d.ts b/lib/rules-by-category.d.ts deleted file mode 100644 index 60f7d2b..0000000 --- a/lib/rules-by-category.d.ts +++ /dev/null @@ -1,327 +0,0 @@ -declare const pedanticRules: { - 'array-callback-return': string; - eqeqeq: string; - 'max-lines': string; - 'no-array-constructor': string; - 'no-case-declarations': string; - 'no-mixed-operators': string; - 'no-new-wrappers': string; - 'no-prototype-builtins': string; - 'no-redeclare': string; - 'no-return-await': string; - 'no-self-compare': string; - 'react/checked-requires-onchange-or-readonly': string; - 'react/no-unescaped-entities': string; - '@typescript-eslint/ban-ts-comment': string; - '@typescript-eslint/ban-types': string; - '@typescript-eslint/no-duplicate-enum-values': string; - '@typescript-eslint/prefer-ts-expect-error': string; - 'unicorn/escape-case': string; - 'unicorn/explicit-length-check': string; - 'unicorn/new-for-builtins': string; - 'unicorn/no-hex-escape': string; - 'unicorn/no-instanceof-array': string; - 'unicorn/no-lonely-if': string; - 'unicorn/no-negated-condition': string; - 'unicorn/no-new-buffer': string; - 'unicorn/no-object-as-default-parameter': string; - 'unicorn/no-static-only-class': string; - 'unicorn/no-this-assignment': string; - 'unicorn/no-typeof-undefined': string; - 'unicorn/no-unreadable-iife': string; - 'unicorn/no-useless-promise-resolve-reject': string; - 'unicorn/no-useless-switch-case': string; - 'unicorn/prefer-array-flat': string; - 'unicorn/prefer-array-some': string; - 'unicorn/prefer-blob-reading-methods': string; - 'unicorn/prefer-code-point': string; - 'unicorn/prefer-date-now': string; - 'unicorn/prefer-dom-node-append': string; - 'unicorn/prefer-dom-node-dataset': string; - 'unicorn/prefer-dom-node-remove': string; - 'unicorn/prefer-event-target': string; - 'unicorn/prefer-math-trunc': string; - 'unicorn/prefer-native-coercion-functions': string; - 'unicorn/prefer-prototype-methods': string; - 'unicorn/prefer-query-selector': string; - 'unicorn/prefer-regexp-test': string; - 'unicorn/prefer-string-replace-all': string; - 'unicorn/prefer-string-slice': string; - 'unicorn/prefer-type-error': string; - 'unicorn/require-number-to-fixed-digits-argument': string; -}; -declare const nurseryRules: { - 'constructor-super': string; - 'getter-return': string; - 'no-fallthrough': string; - 'no-import-assign': string; - 'no-undef': string; - 'import/default': string; - 'import/export': string; - 'import/named': string; - 'import/namespace': string; - 'import/no-amd': string; - 'import/no-cycle': string; - 'import/no-default-export': string; - 'import/no-deprecated': string; - 'import/no-duplicates': string; - 'import/no-named-as-default': string; - 'import/no-named-as-default-member': string; - 'import/no-self-import': string; - 'import/no-unused-modules': string; - 'tree-shaking/no-side-effects-in-initialization': string; -}; -declare const styleRules: { - 'default-case-last': string; - 'default-param-last': string; - 'guard-for-in': string; - 'max-params': string; - 'no-continue': string; - 'no-script-url': string; - 'no-template-curly-in-string': string; - 'no-ternary': string; - 'jest/max-expects': string; - 'jest/no-alias-methods': string; - 'jest/no-confusing-set-timeout': string; - 'jest/no-deprecated-functions': string; - 'jest/no-done-callback': string; - 'jest/no-hooks': string; - 'jest/no-identical-title': string; - 'jest/no-interpolation-in-snapshots': string; - 'jest/no-jasmine-globals': string; - 'jest/no-mocks-import': string; - 'jest/no-restricted-jest-methods': string; - 'jest/no-restricted-matchers': string; - 'jest/no-test-prefixes': string; - 'jest/no-test-return-statement': string; - 'jest/no-untyped-mock-factory': string; - 'jest/prefer-called-with': string; - 'jest/prefer-comparison-matcher': string; - 'jest/prefer-equality-matcher': string; - 'jest/prefer-expect-resolves': string; - 'jest/prefer-lowercase-title': string; - 'jest/prefer-mock-promise-shorthand': string; - 'jest/prefer-spy-on': string; - 'jest/prefer-strict-equal': string; - 'jest/prefer-to-be': string; - 'jest/prefer-to-contain': string; - 'jest/prefer-to-have-length': string; - 'jest/prefer-todo': string; - '@typescript-eslint/adjacent-overload-signatures': string; - '@typescript-eslint/array-type': string; - '@typescript-eslint/ban-tslint-comment': string; - '@typescript-eslint/consistent-type-definitions': string; - '@typescript-eslint/no-empty-interface': string; - '@typescript-eslint/prefer-for-of': string; - '@typescript-eslint/prefer-function-type': string; - 'unicorn/catch-error-name': string; - 'unicorn/empty-brace-spaces': string; - 'unicorn/error-message': string; - 'unicorn/filename-case': string; - 'unicorn/no-await-expression-member': string; - 'unicorn/no-console-spaces': string; - 'unicorn/no-null': string; - 'unicorn/no-unreadable-array-destructuring': string; - 'unicorn/no-zero-fractions': string; - 'unicorn/number-literal-case': string; - 'unicorn/numeric-separators-style': string; - 'unicorn/prefer-array-flat-map': string; - 'unicorn/prefer-dom-node-text-content': string; - 'unicorn/prefer-includes': string; - 'unicorn/prefer-logical-operator-over-ternary': string; - 'unicorn/prefer-modern-dom-apis': string; - 'unicorn/prefer-node-protocol': string; - 'unicorn/prefer-optional-catch-binding': string; - 'unicorn/prefer-reflect-apply': string; - 'unicorn/prefer-spread': string; - 'unicorn/prefer-string-trim-start-end': string; - 'unicorn/require-array-join-separator': string; - 'unicorn/switch-case-braces': string; - 'unicorn/text-encoding-identifier-case': string; - 'unicorn/throw-new-error': string; -}; -declare const correctnessRules: { - 'for-direction': string; - 'no-async-promise-executor': string; - 'no-caller': string; - 'no-class-assign': string; - 'no-compare-neg-zero': string; - 'no-cond-assign': string; - 'no-const-assign': string; - 'no-constant-binary-expression': string; - 'no-constant-condition': string; - 'no-control-regex': string; - 'no-debugger': string; - 'no-delete-var': string; - 'no-dupe-class-members': string; - 'no-dupe-else-if': string; - 'no-dupe-keys': string; - 'no-duplicate-case': string; - 'no-empty-character-class': string; - 'no-empty-pattern': string; - 'no-empty-static-block': string; - 'no-ex-assign': string; - 'no-extra-boolean-cast': string; - 'no-func-assign': string; - 'no-global-assign': string; - 'no-inner-declarations': string; - 'no-irregular-whitespace': string; - 'no-loss-of-precision': string; - 'no-new-symbol': string; - 'no-nonoctal-decimal-escape': string; - 'no-obj-calls': string; - 'no-self-assign': string; - 'no-setter-return': string; - 'no-shadow-restricted-names': string; - 'no-sparse-arrays': string; - 'no-this-before-super': string; - 'no-unsafe-finally': string; - 'no-unsafe-negation': string; - 'no-unused-labels': string; - 'no-unused-private-class-members': string; - 'no-useless-catch': string; - 'no-useless-escape': string; - 'no-useless-rename': string; - 'no-with': string; - 'require-yield': string; - 'use-isnan': string; - 'valid-typeof': string; - 'jest/expect-expect': string; - 'jest/no-conditional-expect': string; - 'jest/no-disabled-tests': string; - 'jest/no-export': string; - 'jest/no-focused-tests': string; - 'jest/no-standalone-expect': string; - 'jest/require-to-throw-message': string; - 'jest/valid-describe-callback': string; - 'jest/valid-expect': string; - 'jest/valid-title': string; - 'jsdoc/check-property-names': string; - 'jsdoc/require-property': string; - 'jsdoc/require-property-description': string; - 'jsdoc/require-property-name': string; - 'jsdoc/require-property-type': string; - 'jsx-a11y/alt-text': string; - 'jsx-a11y/anchor-has-content': string; - 'jsx-a11y/anchor-is-valid': string; - 'jsx-a11y/aria-activedescendant-has-tabindex': string; - 'jsx-a11y/aria-props': string; - 'jsx-a11y/aria-role': string; - 'jsx-a11y/aria-unsupported-elements': string; - 'jsx-a11y/autocomplete-valid': string; - 'jsx-a11y/click-events-have-key-events': string; - 'jsx-a11y/heading-has-content': string; - 'jsx-a11y/html-has-lang': string; - 'jsx-a11y/iframe-has-title': string; - 'jsx-a11y/img-redundant-alt': string; - 'jsx-a11y/lang': string; - 'jsx-a11y/media-has-caption': string; - 'jsx-a11y/mouse-events-have-key-events': string; - 'jsx-a11y/no-access-key': string; - 'jsx-a11y/no-aria-hidden-on-focusable': string; - 'jsx-a11y/no-autofocus': string; - 'jsx-a11y/no-distracting-elements': string; - 'jsx-a11y/no-redundant-roles': string; - 'jsx-a11y/prefer-tag-over-role': string; - 'jsx-a11y/role-has-required-aria-props': string; - 'jsx-a11y/role-supports-aria-props': string; - 'jsx-a11y/scope': string; - 'jsx-a11y/tabindex-no-positive': string; - 'nextjs/google-font-display': string; - 'nextjs/google-font-preconnect': string; - 'nextjs/inline-script-id': string; - 'nextjs/next-script-for-ga': string; - 'nextjs/no-assign-module-variable': string; - 'nextjs/no-async-client-component': string; - 'nextjs/no-before-interactive-script-outside-document': string; - 'nextjs/no-css-tags': string; - 'nextjs/no-document-import-in-page': string; - 'nextjs/no-head-element': string; - 'nextjs/no-head-import-in-document': string; - 'nextjs/no-img-element': string; - 'nextjs/no-script-component-in-head': string; - 'nextjs/no-sync-scripts': string; - 'nextjs/no-title-in-document-head': string; - 'nextjs/no-typos': string; - 'nextjs/no-unwanted-polyfillio': string; - 'react/jsx-key': string; - 'react/jsx-no-duplicate-props': string; - 'react/jsx-no-target-blank': string; - 'react/jsx-no-undef': string; - 'react/jsx-no-useless-fragment': string; - 'react/no-children-prop': string; - 'react/no-direct-mutation-state': string; - 'react/no-find-dom-node': string; - 'react/no-is-mounted': string; - 'react/no-render-return-value': string; - 'react/no-string-refs': string; - 'react/require-render-return': string; - 'react/void-dom-elements-no-children': string; - 'react-perf/jsx-no-jsx-as-prop': string; - 'react-perf/jsx-no-new-array-as-prop': string; - 'react-perf/jsx-no-new-function-as-prop': string; - 'react-perf/jsx-no-new-object-as-prop': string; - '@typescript-eslint/no-extra-non-null-assertion': string; - '@typescript-eslint/no-misused-new': string; - '@typescript-eslint/no-namespace': string; - '@typescript-eslint/no-non-null-asserted-optional-chain': string; - '@typescript-eslint/no-this-alias': string; - '@typescript-eslint/no-unsafe-declaration-merging': string; - '@typescript-eslint/prefer-as-const': string; - '@typescript-eslint/triple-slash-reference': string; - 'unicorn/no-await-in-promise-methods': string; - 'unicorn/no-document-cookie': string; - 'unicorn/no-empty-file': string; - 'unicorn/no-invalid-remove-event-listener': string; - 'unicorn/no-new-array': string; - 'unicorn/no-single-promise-in-promise-methods': string; - 'unicorn/no-thenable': string; - 'unicorn/no-unnecessary-await': string; - 'unicorn/no-useless-fallback-in-spread': string; - 'unicorn/no-useless-length-check': string; - 'unicorn/no-useless-spread': string; - 'unicorn/prefer-set-size': string; - 'unicorn/prefer-string-starts-ends-with': string; -}; -declare const restrictionRules: { - 'no-bitwise': string; - 'no-console': string; - 'no-empty': string; - 'no-eq-null': string; - 'no-eval': string; - 'no-iterator': string; - 'no-proto': string; - 'no-regex-spaces': string; - 'no-unsafe-optional-chaining': string; - 'no-var': string; - 'no-void': string; - 'jsdoc/check-access': string; - 'jsdoc/empty-tags': string; - 'react/button-has-type': string; - 'react/no-danger': string; - 'react/no-unknown-property': string; - '@typescript-eslint/no-explicit-any': string; - '@typescript-eslint/no-var-requires': string; - 'unicorn/no-abusive-eslint-disable': string; - 'unicorn/no-array-for-each': string; - 'unicorn/no-array-reduce': string; - 'unicorn/no-nested-ternary': string; - 'unicorn/no-process-exit': string; - 'unicorn/prefer-modern-math-apis': string; - 'unicorn/prefer-number-properties': string; -}; -declare const suspiciousRules: { - 'jest/no-commented-out-tests': string; - 'react/jsx-no-comment-textnodes': string; - 'react/react-in-jsx-scope': string; - '@typescript-eslint/no-unnecessary-type-constraint': string; - 'unicorn/prefer-add-event-listener': string; -}; -export { - pedanticRules, - nurseryRules, - styleRules, - correctnessRules, - restrictionRules, - suspiciousRules, -}; diff --git a/lib/rules-by-category.mjs b/lib/rules-by-category.mjs deleted file mode 100644 index ee5d783..0000000 --- a/lib/rules-by-category.mjs +++ /dev/null @@ -1,327 +0,0 @@ -const pedanticRules = { - 'array-callback-return': 'off', - eqeqeq: 'off', - 'max-lines': 'off', - 'no-array-constructor': 'off', - 'no-case-declarations': 'off', - 'no-mixed-operators': 'off', - 'no-new-wrappers': 'off', - 'no-prototype-builtins': 'off', - 'no-redeclare': 'off', - 'no-return-await': 'off', - 'no-self-compare': 'off', - 'react/checked-requires-onchange-or-readonly': 'off', - 'react/no-unescaped-entities': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/ban-types': 'off', - '@typescript-eslint/no-duplicate-enum-values': 'off', - '@typescript-eslint/prefer-ts-expect-error': 'off', - 'unicorn/escape-case': 'off', - 'unicorn/explicit-length-check': 'off', - 'unicorn/new-for-builtins': 'off', - 'unicorn/no-hex-escape': 'off', - 'unicorn/no-instanceof-array': 'off', - 'unicorn/no-lonely-if': 'off', - 'unicorn/no-negated-condition': 'off', - 'unicorn/no-new-buffer': 'off', - 'unicorn/no-object-as-default-parameter': 'off', - 'unicorn/no-static-only-class': 'off', - 'unicorn/no-this-assignment': 'off', - 'unicorn/no-typeof-undefined': 'off', - 'unicorn/no-unreadable-iife': 'off', - 'unicorn/no-useless-promise-resolve-reject': 'off', - 'unicorn/no-useless-switch-case': 'off', - 'unicorn/prefer-array-flat': 'off', - 'unicorn/prefer-array-some': 'off', - 'unicorn/prefer-blob-reading-methods': 'off', - 'unicorn/prefer-code-point': 'off', - 'unicorn/prefer-date-now': 'off', - 'unicorn/prefer-dom-node-append': 'off', - 'unicorn/prefer-dom-node-dataset': 'off', - 'unicorn/prefer-dom-node-remove': 'off', - 'unicorn/prefer-event-target': 'off', - 'unicorn/prefer-math-trunc': 'off', - 'unicorn/prefer-native-coercion-functions': 'off', - 'unicorn/prefer-prototype-methods': 'off', - 'unicorn/prefer-query-selector': 'off', - 'unicorn/prefer-regexp-test': 'off', - 'unicorn/prefer-string-replace-all': 'off', - 'unicorn/prefer-string-slice': 'off', - 'unicorn/prefer-type-error': 'off', - 'unicorn/require-number-to-fixed-digits-argument': 'off', -}; -const nurseryRules = { - 'constructor-super': 'off', - 'getter-return': 'off', - 'no-fallthrough': 'off', - 'no-import-assign': 'off', - 'no-undef': 'off', - 'import/default': 'off', - 'import/export': 'off', - 'import/named': 'off', - 'import/namespace': 'off', - 'import/no-amd': 'off', - 'import/no-cycle': 'off', - 'import/no-default-export': 'off', - 'import/no-deprecated': 'off', - 'import/no-duplicates': 'off', - 'import/no-named-as-default': 'off', - 'import/no-named-as-default-member': 'off', - 'import/no-self-import': 'off', - 'import/no-unused-modules': 'off', - 'tree-shaking/no-side-effects-in-initialization': 'off', -}; -const styleRules = { - 'default-case-last': 'off', - 'default-param-last': 'off', - 'guard-for-in': 'off', - 'max-params': 'off', - 'no-continue': 'off', - 'no-script-url': 'off', - 'no-template-curly-in-string': 'off', - 'no-ternary': 'off', - 'jest/max-expects': 'off', - 'jest/no-alias-methods': 'off', - 'jest/no-confusing-set-timeout': 'off', - 'jest/no-deprecated-functions': 'off', - 'jest/no-done-callback': 'off', - 'jest/no-hooks': 'off', - 'jest/no-identical-title': 'off', - 'jest/no-interpolation-in-snapshots': 'off', - 'jest/no-jasmine-globals': 'off', - 'jest/no-mocks-import': 'off', - 'jest/no-restricted-jest-methods': 'off', - 'jest/no-restricted-matchers': 'off', - 'jest/no-test-prefixes': 'off', - 'jest/no-test-return-statement': 'off', - 'jest/no-untyped-mock-factory': 'off', - 'jest/prefer-called-with': 'off', - 'jest/prefer-comparison-matcher': 'off', - 'jest/prefer-equality-matcher': 'off', - 'jest/prefer-expect-resolves': 'off', - 'jest/prefer-lowercase-title': 'off', - 'jest/prefer-mock-promise-shorthand': 'off', - 'jest/prefer-spy-on': 'off', - 'jest/prefer-strict-equal': 'off', - 'jest/prefer-to-be': 'off', - 'jest/prefer-to-contain': 'off', - 'jest/prefer-to-have-length': 'off', - 'jest/prefer-todo': 'off', - '@typescript-eslint/adjacent-overload-signatures': 'off', - '@typescript-eslint/array-type': 'off', - '@typescript-eslint/ban-tslint-comment': 'off', - '@typescript-eslint/consistent-type-definitions': 'off', - '@typescript-eslint/no-empty-interface': 'off', - '@typescript-eslint/prefer-for-of': 'off', - '@typescript-eslint/prefer-function-type': 'off', - 'unicorn/catch-error-name': 'off', - 'unicorn/empty-brace-spaces': 'off', - 'unicorn/error-message': 'off', - 'unicorn/filename-case': 'off', - 'unicorn/no-await-expression-member': 'off', - 'unicorn/no-console-spaces': 'off', - 'unicorn/no-null': 'off', - 'unicorn/no-unreadable-array-destructuring': 'off', - 'unicorn/no-zero-fractions': 'off', - 'unicorn/number-literal-case': 'off', - 'unicorn/numeric-separators-style': 'off', - 'unicorn/prefer-array-flat-map': 'off', - 'unicorn/prefer-dom-node-text-content': 'off', - 'unicorn/prefer-includes': 'off', - 'unicorn/prefer-logical-operator-over-ternary': 'off', - 'unicorn/prefer-modern-dom-apis': 'off', - 'unicorn/prefer-node-protocol': 'off', - 'unicorn/prefer-optional-catch-binding': 'off', - 'unicorn/prefer-reflect-apply': 'off', - 'unicorn/prefer-spread': 'off', - 'unicorn/prefer-string-trim-start-end': 'off', - 'unicorn/require-array-join-separator': 'off', - 'unicorn/switch-case-braces': 'off', - 'unicorn/text-encoding-identifier-case': 'off', - 'unicorn/throw-new-error': 'off', -}; -const correctnessRules = { - 'for-direction': 'off', - 'no-async-promise-executor': 'off', - 'no-caller': 'off', - 'no-class-assign': 'off', - 'no-compare-neg-zero': 'off', - 'no-cond-assign': 'off', - 'no-const-assign': 'off', - 'no-constant-binary-expression': 'off', - 'no-constant-condition': 'off', - 'no-control-regex': 'off', - 'no-debugger': 'off', - 'no-delete-var': 'off', - 'no-dupe-class-members': 'off', - 'no-dupe-else-if': 'off', - 'no-dupe-keys': 'off', - 'no-duplicate-case': 'off', - 'no-empty-character-class': 'off', - 'no-empty-pattern': 'off', - 'no-empty-static-block': 'off', - 'no-ex-assign': 'off', - 'no-extra-boolean-cast': 'off', - 'no-func-assign': 'off', - 'no-global-assign': 'off', - 'no-inner-declarations': 'off', - 'no-irregular-whitespace': 'off', - 'no-loss-of-precision': 'off', - 'no-new-symbol': 'off', - 'no-nonoctal-decimal-escape': 'off', - 'no-obj-calls': 'off', - 'no-self-assign': 'off', - 'no-setter-return': 'off', - 'no-shadow-restricted-names': 'off', - 'no-sparse-arrays': 'off', - 'no-this-before-super': 'off', - 'no-unsafe-finally': 'off', - 'no-unsafe-negation': 'off', - 'no-unused-labels': 'off', - 'no-unused-private-class-members': 'off', - 'no-useless-catch': 'off', - 'no-useless-escape': 'off', - 'no-useless-rename': 'off', - 'no-with': 'off', - 'require-yield': 'off', - 'use-isnan': 'off', - 'valid-typeof': 'off', - 'jest/expect-expect': 'off', - 'jest/no-conditional-expect': 'off', - 'jest/no-disabled-tests': 'off', - 'jest/no-export': 'off', - 'jest/no-focused-tests': 'off', - 'jest/no-standalone-expect': 'off', - 'jest/require-to-throw-message': 'off', - 'jest/valid-describe-callback': 'off', - 'jest/valid-expect': 'off', - 'jest/valid-title': 'off', - 'jsdoc/check-property-names': 'off', - 'jsdoc/require-property': 'off', - 'jsdoc/require-property-description': 'off', - 'jsdoc/require-property-name': 'off', - 'jsdoc/require-property-type': 'off', - 'jsx-a11y/alt-text': 'off', - 'jsx-a11y/anchor-has-content': 'off', - 'jsx-a11y/anchor-is-valid': 'off', - 'jsx-a11y/aria-activedescendant-has-tabindex': 'off', - 'jsx-a11y/aria-props': 'off', - 'jsx-a11y/aria-role': 'off', - 'jsx-a11y/aria-unsupported-elements': 'off', - 'jsx-a11y/autocomplete-valid': 'off', - 'jsx-a11y/click-events-have-key-events': 'off', - 'jsx-a11y/heading-has-content': 'off', - 'jsx-a11y/html-has-lang': 'off', - 'jsx-a11y/iframe-has-title': 'off', - 'jsx-a11y/img-redundant-alt': 'off', - 'jsx-a11y/lang': 'off', - 'jsx-a11y/media-has-caption': 'off', - 'jsx-a11y/mouse-events-have-key-events': 'off', - 'jsx-a11y/no-access-key': 'off', - 'jsx-a11y/no-aria-hidden-on-focusable': 'off', - 'jsx-a11y/no-autofocus': 'off', - 'jsx-a11y/no-distracting-elements': 'off', - 'jsx-a11y/no-redundant-roles': 'off', - 'jsx-a11y/prefer-tag-over-role': 'off', - 'jsx-a11y/role-has-required-aria-props': 'off', - 'jsx-a11y/role-supports-aria-props': 'off', - 'jsx-a11y/scope': 'off', - 'jsx-a11y/tabindex-no-positive': 'off', - 'nextjs/google-font-display': 'off', - 'nextjs/google-font-preconnect': 'off', - 'nextjs/inline-script-id': 'off', - 'nextjs/next-script-for-ga': 'off', - 'nextjs/no-assign-module-variable': 'off', - 'nextjs/no-async-client-component': 'off', - 'nextjs/no-before-interactive-script-outside-document': 'off', - 'nextjs/no-css-tags': 'off', - 'nextjs/no-document-import-in-page': 'off', - 'nextjs/no-head-element': 'off', - 'nextjs/no-head-import-in-document': 'off', - 'nextjs/no-img-element': 'off', - 'nextjs/no-script-component-in-head': 'off', - 'nextjs/no-sync-scripts': 'off', - 'nextjs/no-title-in-document-head': 'off', - 'nextjs/no-typos': 'off', - 'nextjs/no-unwanted-polyfillio': 'off', - 'react/jsx-key': 'off', - 'react/jsx-no-duplicate-props': 'off', - 'react/jsx-no-target-blank': 'off', - 'react/jsx-no-undef': 'off', - 'react/jsx-no-useless-fragment': 'off', - 'react/no-children-prop': 'off', - 'react/no-direct-mutation-state': 'off', - 'react/no-find-dom-node': 'off', - 'react/no-is-mounted': 'off', - 'react/no-render-return-value': 'off', - 'react/no-string-refs': 'off', - 'react/require-render-return': 'off', - 'react/void-dom-elements-no-children': 'off', - 'react-perf/jsx-no-jsx-as-prop': 'off', - 'react-perf/jsx-no-new-array-as-prop': 'off', - 'react-perf/jsx-no-new-function-as-prop': 'off', - 'react-perf/jsx-no-new-object-as-prop': 'off', - '@typescript-eslint/no-extra-non-null-assertion': 'off', - '@typescript-eslint/no-misused-new': 'off', - '@typescript-eslint/no-namespace': 'off', - '@typescript-eslint/no-non-null-asserted-optional-chain': 'off', - '@typescript-eslint/no-this-alias': 'off', - '@typescript-eslint/no-unsafe-declaration-merging': 'off', - '@typescript-eslint/prefer-as-const': 'off', - '@typescript-eslint/triple-slash-reference': 'off', - 'unicorn/no-await-in-promise-methods': 'off', - 'unicorn/no-document-cookie': 'off', - 'unicorn/no-empty-file': 'off', - 'unicorn/no-invalid-remove-event-listener': 'off', - 'unicorn/no-new-array': 'off', - 'unicorn/no-single-promise-in-promise-methods': 'off', - 'unicorn/no-thenable': 'off', - 'unicorn/no-unnecessary-await': 'off', - 'unicorn/no-useless-fallback-in-spread': 'off', - 'unicorn/no-useless-length-check': 'off', - 'unicorn/no-useless-spread': 'off', - 'unicorn/prefer-set-size': 'off', - 'unicorn/prefer-string-starts-ends-with': 'off', -}; -const restrictionRules = { - 'no-bitwise': 'off', - 'no-console': 'off', - 'no-empty': 'off', - 'no-eq-null': 'off', - 'no-eval': 'off', - 'no-iterator': 'off', - 'no-proto': 'off', - 'no-regex-spaces': 'off', - 'no-unsafe-optional-chaining': 'off', - 'no-var': 'off', - 'no-void': 'off', - 'jsdoc/check-access': 'off', - 'jsdoc/empty-tags': 'off', - 'react/button-has-type': 'off', - 'react/no-danger': 'off', - 'react/no-unknown-property': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-var-requires': 'off', - 'unicorn/no-abusive-eslint-disable': 'off', - 'unicorn/no-array-for-each': 'off', - 'unicorn/no-array-reduce': 'off', - 'unicorn/no-nested-ternary': 'off', - 'unicorn/no-process-exit': 'off', - 'unicorn/prefer-modern-math-apis': 'off', - 'unicorn/prefer-number-properties': 'off', -}; -const suspiciousRules = { - 'jest/no-commented-out-tests': 'off', - 'react/jsx-no-comment-textnodes': 'off', - 'react/react-in-jsx-scope': 'off', - '@typescript-eslint/no-unnecessary-type-constraint': 'off', - 'unicorn/prefer-add-event-listener': 'off', -}; -export { - correctnessRules, - nurseryRules, - pedanticRules, - restrictionRules, - styleRules, - suspiciousRules, -}; diff --git a/lib/rules-by-scope.cjs b/lib/rules-by-scope.cjs deleted file mode 100644 index 8ef9286..0000000 --- a/lib/rules-by-scope.cjs +++ /dev/null @@ -1,342 +0,0 @@ -'use strict'; -Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const eslintRules = { - 'array-callback-return': 'off', - 'constructor-super': 'off', - 'default-case-last': 'off', - 'default-param-last': 'off', - eqeqeq: 'off', - 'for-direction': 'off', - 'getter-return': 'off', - 'guard-for-in': 'off', - 'max-lines': 'off', - 'max-params': 'off', - 'no-array-constructor': 'off', - 'no-async-promise-executor': 'off', - 'no-bitwise': 'off', - 'no-caller': 'off', - 'no-case-declarations': 'off', - 'no-class-assign': 'off', - 'no-compare-neg-zero': 'off', - 'no-cond-assign': 'off', - 'no-console': 'off', - 'no-const-assign': 'off', - 'no-constant-binary-expression': 'off', - 'no-constant-condition': 'off', - 'no-continue': 'off', - 'no-control-regex': 'off', - 'no-debugger': 'off', - 'no-delete-var': 'off', - 'no-dupe-class-members': 'off', - 'no-dupe-else-if': 'off', - 'no-dupe-keys': 'off', - 'no-duplicate-case': 'off', - 'no-empty': 'off', - 'no-empty-character-class': 'off', - 'no-empty-pattern': 'off', - 'no-empty-static-block': 'off', - 'no-eq-null': 'off', - 'no-eval': 'off', - 'no-ex-assign': 'off', - 'no-extra-boolean-cast': 'off', - 'no-fallthrough': 'off', - 'no-func-assign': 'off', - 'no-global-assign': 'off', - 'no-import-assign': 'off', - 'no-inner-declarations': 'off', - 'no-irregular-whitespace': 'off', - 'no-iterator': 'off', - 'no-loss-of-precision': 'off', - 'no-mixed-operators': 'off', - 'no-new-symbol': 'off', - 'no-new-wrappers': 'off', - 'no-nonoctal-decimal-escape': 'off', - 'no-obj-calls': 'off', - 'no-proto': 'off', - 'no-prototype-builtins': 'off', - 'no-redeclare': 'off', - 'no-regex-spaces': 'off', - 'no-return-await': 'off', - 'no-script-url': 'off', - 'no-self-assign': 'off', - 'no-self-compare': 'off', - 'no-setter-return': 'off', - 'no-shadow-restricted-names': 'off', - 'no-sparse-arrays': 'off', - 'no-template-curly-in-string': 'off', - 'no-ternary': 'off', - 'no-this-before-super': 'off', - 'no-undef': 'off', - 'no-unsafe-finally': 'off', - 'no-unsafe-negation': 'off', - 'no-unsafe-optional-chaining': 'off', - 'no-unused-labels': 'off', - 'no-unused-private-class-members': 'off', - 'no-useless-catch': 'off', - 'no-useless-escape': 'off', - 'no-useless-rename': 'off', - 'no-var': 'off', - 'no-void': 'off', - 'no-with': 'off', - 'require-yield': 'off', - 'use-isnan': 'off', - 'valid-typeof': 'off', -}; -const importRules = { - 'import/default': 'off', - 'import/export': 'off', - 'import/named': 'off', - 'import/namespace': 'off', - 'import/no-amd': 'off', - 'import/no-cycle': 'off', - 'import/no-default-export': 'off', - 'import/no-deprecated': 'off', - 'import/no-duplicates': 'off', - 'import/no-named-as-default': 'off', - 'import/no-named-as-default-member': 'off', - 'import/no-self-import': 'off', - 'import/no-unused-modules': 'off', -}; -const jestRules = { - 'jest/expect-expect': 'off', - 'jest/max-expects': 'off', - 'jest/no-alias-methods': 'off', - 'jest/no-commented-out-tests': 'off', - 'jest/no-conditional-expect': 'off', - 'jest/no-confusing-set-timeout': 'off', - 'jest/no-deprecated-functions': 'off', - 'jest/no-disabled-tests': 'off', - 'jest/no-done-callback': 'off', - 'jest/no-export': 'off', - 'jest/no-focused-tests': 'off', - 'jest/no-hooks': 'off', - 'jest/no-identical-title': 'off', - 'jest/no-interpolation-in-snapshots': 'off', - 'jest/no-jasmine-globals': 'off', - 'jest/no-mocks-import': 'off', - 'jest/no-restricted-jest-methods': 'off', - 'jest/no-restricted-matchers': 'off', - 'jest/no-standalone-expect': 'off', - 'jest/no-test-prefixes': 'off', - 'jest/no-test-return-statement': 'off', - 'jest/no-untyped-mock-factory': 'off', - 'jest/prefer-called-with': 'off', - 'jest/prefer-comparison-matcher': 'off', - 'jest/prefer-equality-matcher': 'off', - 'jest/prefer-expect-resolves': 'off', - 'jest/prefer-lowercase-title': 'off', - 'jest/prefer-mock-promise-shorthand': 'off', - 'jest/prefer-spy-on': 'off', - 'jest/prefer-strict-equal': 'off', - 'jest/prefer-to-be': 'off', - 'jest/prefer-to-contain': 'off', - 'jest/prefer-to-have-length': 'off', - 'jest/prefer-todo': 'off', - 'jest/require-to-throw-message': 'off', - 'jest/valid-describe-callback': 'off', - 'jest/valid-expect': 'off', - 'jest/valid-title': 'off', -}; -const jsdocRules = { - 'jsdoc/check-access': 'off', - 'jsdoc/check-property-names': 'off', - 'jsdoc/empty-tags': 'off', - 'jsdoc/require-property': 'off', - 'jsdoc/require-property-description': 'off', - 'jsdoc/require-property-name': 'off', - 'jsdoc/require-property-type': 'off', -}; -const jsxA11yRules = { - 'jsx-a11y/alt-text': 'off', - 'jsx-a11y/anchor-has-content': 'off', - 'jsx-a11y/anchor-is-valid': 'off', - 'jsx-a11y/aria-activedescendant-has-tabindex': 'off', - 'jsx-a11y/aria-props': 'off', - 'jsx-a11y/aria-role': 'off', - 'jsx-a11y/aria-unsupported-elements': 'off', - 'jsx-a11y/autocomplete-valid': 'off', - 'jsx-a11y/click-events-have-key-events': 'off', - 'jsx-a11y/heading-has-content': 'off', - 'jsx-a11y/html-has-lang': 'off', - 'jsx-a11y/iframe-has-title': 'off', - 'jsx-a11y/img-redundant-alt': 'off', - 'jsx-a11y/lang': 'off', - 'jsx-a11y/media-has-caption': 'off', - 'jsx-a11y/mouse-events-have-key-events': 'off', - 'jsx-a11y/no-access-key': 'off', - 'jsx-a11y/no-aria-hidden-on-focusable': 'off', - 'jsx-a11y/no-autofocus': 'off', - 'jsx-a11y/no-distracting-elements': 'off', - 'jsx-a11y/no-redundant-roles': 'off', - 'jsx-a11y/prefer-tag-over-role': 'off', - 'jsx-a11y/role-has-required-aria-props': 'off', - 'jsx-a11y/role-supports-aria-props': 'off', - 'jsx-a11y/scope': 'off', - 'jsx-a11y/tabindex-no-positive': 'off', -}; -const nextjsRules = { - 'nextjs/google-font-display': 'off', - 'nextjs/google-font-preconnect': 'off', - 'nextjs/inline-script-id': 'off', - 'nextjs/next-script-for-ga': 'off', - 'nextjs/no-assign-module-variable': 'off', - 'nextjs/no-async-client-component': 'off', - 'nextjs/no-before-interactive-script-outside-document': 'off', - 'nextjs/no-css-tags': 'off', - 'nextjs/no-document-import-in-page': 'off', - 'nextjs/no-head-element': 'off', - 'nextjs/no-head-import-in-document': 'off', - 'nextjs/no-img-element': 'off', - 'nextjs/no-script-component-in-head': 'off', - 'nextjs/no-sync-scripts': 'off', - 'nextjs/no-title-in-document-head': 'off', - 'nextjs/no-typos': 'off', - 'nextjs/no-unwanted-polyfillio': 'off', -}; -const reactRules = { - 'react/button-has-type': 'off', - 'react/checked-requires-onchange-or-readonly': 'off', - 'react/jsx-key': 'off', - 'react/jsx-no-comment-textnodes': 'off', - 'react/jsx-no-duplicate-props': 'off', - 'react/jsx-no-target-blank': 'off', - 'react/jsx-no-undef': 'off', - 'react/jsx-no-useless-fragment': 'off', - 'react/no-children-prop': 'off', - 'react/no-danger': 'off', - 'react/no-direct-mutation-state': 'off', - 'react/no-find-dom-node': 'off', - 'react/no-is-mounted': 'off', - 'react/no-render-return-value': 'off', - 'react/no-string-refs': 'off', - 'react/no-unescaped-entities': 'off', - 'react/no-unknown-property': 'off', - 'react/react-in-jsx-scope': 'off', - 'react/require-render-return': 'off', - 'react/void-dom-elements-no-children': 'off', -}; -const reactPerfRules = { - 'react-perf/jsx-no-jsx-as-prop': 'off', - 'react-perf/jsx-no-new-array-as-prop': 'off', - 'react-perf/jsx-no-new-function-as-prop': 'off', - 'react-perf/jsx-no-new-object-as-prop': 'off', -}; -const treeShakingRules = { - 'tree-shaking/no-side-effects-in-initialization': 'off', -}; -const typescriptRules = { - '@typescript-eslint/adjacent-overload-signatures': 'off', - '@typescript-eslint/array-type': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/ban-tslint-comment': 'off', - '@typescript-eslint/ban-types': 'off', - '@typescript-eslint/consistent-type-definitions': 'off', - '@typescript-eslint/no-duplicate-enum-values': 'off', - '@typescript-eslint/no-empty-interface': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-extra-non-null-assertion': 'off', - '@typescript-eslint/no-misused-new': 'off', - '@typescript-eslint/no-namespace': 'off', - '@typescript-eslint/no-non-null-asserted-optional-chain': 'off', - '@typescript-eslint/no-this-alias': 'off', - '@typescript-eslint/no-unnecessary-type-constraint': 'off', - '@typescript-eslint/no-unsafe-declaration-merging': 'off', - '@typescript-eslint/no-var-requires': 'off', - '@typescript-eslint/prefer-as-const': 'off', - '@typescript-eslint/prefer-for-of': 'off', - '@typescript-eslint/prefer-function-type': 'off', - '@typescript-eslint/prefer-ts-expect-error': 'off', - '@typescript-eslint/triple-slash-reference': 'off', -}; -const unicornRules = { - 'unicorn/catch-error-name': 'off', - 'unicorn/empty-brace-spaces': 'off', - 'unicorn/error-message': 'off', - 'unicorn/escape-case': 'off', - 'unicorn/explicit-length-check': 'off', - 'unicorn/filename-case': 'off', - 'unicorn/new-for-builtins': 'off', - 'unicorn/no-abusive-eslint-disable': 'off', - 'unicorn/no-array-for-each': 'off', - 'unicorn/no-array-reduce': 'off', - 'unicorn/no-await-expression-member': 'off', - 'unicorn/no-await-in-promise-methods': 'off', - 'unicorn/no-console-spaces': 'off', - 'unicorn/no-document-cookie': 'off', - 'unicorn/no-empty-file': 'off', - 'unicorn/no-hex-escape': 'off', - 'unicorn/no-instanceof-array': 'off', - 'unicorn/no-invalid-remove-event-listener': 'off', - 'unicorn/no-lonely-if': 'off', - 'unicorn/no-negated-condition': 'off', - 'unicorn/no-nested-ternary': 'off', - 'unicorn/no-new-array': 'off', - 'unicorn/no-new-buffer': 'off', - 'unicorn/no-null': 'off', - 'unicorn/no-object-as-default-parameter': 'off', - 'unicorn/no-process-exit': 'off', - 'unicorn/no-single-promise-in-promise-methods': 'off', - 'unicorn/no-static-only-class': 'off', - 'unicorn/no-thenable': 'off', - 'unicorn/no-this-assignment': 'off', - 'unicorn/no-typeof-undefined': 'off', - 'unicorn/no-unnecessary-await': 'off', - 'unicorn/no-unreadable-array-destructuring': 'off', - 'unicorn/no-unreadable-iife': 'off', - 'unicorn/no-useless-fallback-in-spread': 'off', - 'unicorn/no-useless-length-check': 'off', - 'unicorn/no-useless-promise-resolve-reject': 'off', - 'unicorn/no-useless-spread': 'off', - 'unicorn/no-useless-switch-case': 'off', - 'unicorn/no-zero-fractions': 'off', - 'unicorn/number-literal-case': 'off', - 'unicorn/numeric-separators-style': 'off', - 'unicorn/prefer-add-event-listener': 'off', - 'unicorn/prefer-array-flat': 'off', - 'unicorn/prefer-array-flat-map': 'off', - 'unicorn/prefer-array-some': 'off', - 'unicorn/prefer-blob-reading-methods': 'off', - 'unicorn/prefer-code-point': 'off', - 'unicorn/prefer-date-now': 'off', - 'unicorn/prefer-dom-node-append': 'off', - 'unicorn/prefer-dom-node-dataset': 'off', - 'unicorn/prefer-dom-node-remove': 'off', - 'unicorn/prefer-dom-node-text-content': 'off', - 'unicorn/prefer-event-target': 'off', - 'unicorn/prefer-includes': 'off', - 'unicorn/prefer-logical-operator-over-ternary': 'off', - 'unicorn/prefer-math-trunc': 'off', - 'unicorn/prefer-modern-dom-apis': 'off', - 'unicorn/prefer-modern-math-apis': 'off', - 'unicorn/prefer-native-coercion-functions': 'off', - 'unicorn/prefer-node-protocol': 'off', - 'unicorn/prefer-number-properties': 'off', - 'unicorn/prefer-optional-catch-binding': 'off', - 'unicorn/prefer-prototype-methods': 'off', - 'unicorn/prefer-query-selector': 'off', - 'unicorn/prefer-reflect-apply': 'off', - 'unicorn/prefer-regexp-test': 'off', - 'unicorn/prefer-set-size': 'off', - 'unicorn/prefer-spread': 'off', - 'unicorn/prefer-string-replace-all': 'off', - 'unicorn/prefer-string-slice': 'off', - 'unicorn/prefer-string-starts-ends-with': 'off', - 'unicorn/prefer-string-trim-start-end': 'off', - 'unicorn/prefer-type-error': 'off', - 'unicorn/require-array-join-separator': 'off', - 'unicorn/require-number-to-fixed-digits-argument': 'off', - 'unicorn/switch-case-braces': 'off', - 'unicorn/text-encoding-identifier-case': 'off', - 'unicorn/throw-new-error': 'off', -}; -exports.eslintRules = eslintRules; -exports.importRules = importRules; -exports.jestRules = jestRules; -exports.jsdocRules = jsdocRules; -exports.jsxA11yRules = jsxA11yRules; -exports.nextjsRules = nextjsRules; -exports.reactPerfRules = reactPerfRules; -exports.reactRules = reactRules; -exports.treeShakingRules = treeShakingRules; -exports.typescriptRules = typescriptRules; -exports.unicornRules = unicornRules; diff --git a/lib/rules-by-scope.d.ts b/lib/rules-by-scope.d.ts deleted file mode 100644 index 89b041d..0000000 --- a/lib/rules-by-scope.d.ts +++ /dev/null @@ -1,342 +0,0 @@ -declare const eslintRules: { - 'array-callback-return': string; - 'constructor-super': string; - 'default-case-last': string; - 'default-param-last': string; - eqeqeq: string; - 'for-direction': string; - 'getter-return': string; - 'guard-for-in': string; - 'max-lines': string; - 'max-params': string; - 'no-array-constructor': string; - 'no-async-promise-executor': string; - 'no-bitwise': string; - 'no-caller': string; - 'no-case-declarations': string; - 'no-class-assign': string; - 'no-compare-neg-zero': string; - 'no-cond-assign': string; - 'no-console': string; - 'no-const-assign': string; - 'no-constant-binary-expression': string; - 'no-constant-condition': string; - 'no-continue': string; - 'no-control-regex': string; - 'no-debugger': string; - 'no-delete-var': string; - 'no-dupe-class-members': string; - 'no-dupe-else-if': string; - 'no-dupe-keys': string; - 'no-duplicate-case': string; - 'no-empty': string; - 'no-empty-character-class': string; - 'no-empty-pattern': string; - 'no-empty-static-block': string; - 'no-eq-null': string; - 'no-eval': string; - 'no-ex-assign': string; - 'no-extra-boolean-cast': string; - 'no-fallthrough': string; - 'no-func-assign': string; - 'no-global-assign': string; - 'no-import-assign': string; - 'no-inner-declarations': string; - 'no-irregular-whitespace': string; - 'no-iterator': string; - 'no-loss-of-precision': string; - 'no-mixed-operators': string; - 'no-new-symbol': string; - 'no-new-wrappers': string; - 'no-nonoctal-decimal-escape': string; - 'no-obj-calls': string; - 'no-proto': string; - 'no-prototype-builtins': string; - 'no-redeclare': string; - 'no-regex-spaces': string; - 'no-return-await': string; - 'no-script-url': string; - 'no-self-assign': string; - 'no-self-compare': string; - 'no-setter-return': string; - 'no-shadow-restricted-names': string; - 'no-sparse-arrays': string; - 'no-template-curly-in-string': string; - 'no-ternary': string; - 'no-this-before-super': string; - 'no-undef': string; - 'no-unsafe-finally': string; - 'no-unsafe-negation': string; - 'no-unsafe-optional-chaining': string; - 'no-unused-labels': string; - 'no-unused-private-class-members': string; - 'no-useless-catch': string; - 'no-useless-escape': string; - 'no-useless-rename': string; - 'no-var': string; - 'no-void': string; - 'no-with': string; - 'require-yield': string; - 'use-isnan': string; - 'valid-typeof': string; -}; -declare const importRules: { - 'import/default': string; - 'import/export': string; - 'import/named': string; - 'import/namespace': string; - 'import/no-amd': string; - 'import/no-cycle': string; - 'import/no-default-export': string; - 'import/no-deprecated': string; - 'import/no-duplicates': string; - 'import/no-named-as-default': string; - 'import/no-named-as-default-member': string; - 'import/no-self-import': string; - 'import/no-unused-modules': string; -}; -declare const jestRules: { - 'jest/expect-expect': string; - 'jest/max-expects': string; - 'jest/no-alias-methods': string; - 'jest/no-commented-out-tests': string; - 'jest/no-conditional-expect': string; - 'jest/no-confusing-set-timeout': string; - 'jest/no-deprecated-functions': string; - 'jest/no-disabled-tests': string; - 'jest/no-done-callback': string; - 'jest/no-export': string; - 'jest/no-focused-tests': string; - 'jest/no-hooks': string; - 'jest/no-identical-title': string; - 'jest/no-interpolation-in-snapshots': string; - 'jest/no-jasmine-globals': string; - 'jest/no-mocks-import': string; - 'jest/no-restricted-jest-methods': string; - 'jest/no-restricted-matchers': string; - 'jest/no-standalone-expect': string; - 'jest/no-test-prefixes': string; - 'jest/no-test-return-statement': string; - 'jest/no-untyped-mock-factory': string; - 'jest/prefer-called-with': string; - 'jest/prefer-comparison-matcher': string; - 'jest/prefer-equality-matcher': string; - 'jest/prefer-expect-resolves': string; - 'jest/prefer-lowercase-title': string; - 'jest/prefer-mock-promise-shorthand': string; - 'jest/prefer-spy-on': string; - 'jest/prefer-strict-equal': string; - 'jest/prefer-to-be': string; - 'jest/prefer-to-contain': string; - 'jest/prefer-to-have-length': string; - 'jest/prefer-todo': string; - 'jest/require-to-throw-message': string; - 'jest/valid-describe-callback': string; - 'jest/valid-expect': string; - 'jest/valid-title': string; -}; -declare const jsdocRules: { - 'jsdoc/check-access': string; - 'jsdoc/check-property-names': string; - 'jsdoc/empty-tags': string; - 'jsdoc/require-property': string; - 'jsdoc/require-property-description': string; - 'jsdoc/require-property-name': string; - 'jsdoc/require-property-type': string; -}; -declare const jsxA11yRules: { - 'jsx-a11y/alt-text': string; - 'jsx-a11y/anchor-has-content': string; - 'jsx-a11y/anchor-is-valid': string; - 'jsx-a11y/aria-activedescendant-has-tabindex': string; - 'jsx-a11y/aria-props': string; - 'jsx-a11y/aria-role': string; - 'jsx-a11y/aria-unsupported-elements': string; - 'jsx-a11y/autocomplete-valid': string; - 'jsx-a11y/click-events-have-key-events': string; - 'jsx-a11y/heading-has-content': string; - 'jsx-a11y/html-has-lang': string; - 'jsx-a11y/iframe-has-title': string; - 'jsx-a11y/img-redundant-alt': string; - 'jsx-a11y/lang': string; - 'jsx-a11y/media-has-caption': string; - 'jsx-a11y/mouse-events-have-key-events': string; - 'jsx-a11y/no-access-key': string; - 'jsx-a11y/no-aria-hidden-on-focusable': string; - 'jsx-a11y/no-autofocus': string; - 'jsx-a11y/no-distracting-elements': string; - 'jsx-a11y/no-redundant-roles': string; - 'jsx-a11y/prefer-tag-over-role': string; - 'jsx-a11y/role-has-required-aria-props': string; - 'jsx-a11y/role-supports-aria-props': string; - 'jsx-a11y/scope': string; - 'jsx-a11y/tabindex-no-positive': string; -}; -declare const nextjsRules: { - 'nextjs/google-font-display': string; - 'nextjs/google-font-preconnect': string; - 'nextjs/inline-script-id': string; - 'nextjs/next-script-for-ga': string; - 'nextjs/no-assign-module-variable': string; - 'nextjs/no-async-client-component': string; - 'nextjs/no-before-interactive-script-outside-document': string; - 'nextjs/no-css-tags': string; - 'nextjs/no-document-import-in-page': string; - 'nextjs/no-head-element': string; - 'nextjs/no-head-import-in-document': string; - 'nextjs/no-img-element': string; - 'nextjs/no-script-component-in-head': string; - 'nextjs/no-sync-scripts': string; - 'nextjs/no-title-in-document-head': string; - 'nextjs/no-typos': string; - 'nextjs/no-unwanted-polyfillio': string; -}; -declare const reactRules: { - 'react/button-has-type': string; - 'react/checked-requires-onchange-or-readonly': string; - 'react/jsx-key': string; - 'react/jsx-no-comment-textnodes': string; - 'react/jsx-no-duplicate-props': string; - 'react/jsx-no-target-blank': string; - 'react/jsx-no-undef': string; - 'react/jsx-no-useless-fragment': string; - 'react/no-children-prop': string; - 'react/no-danger': string; - 'react/no-direct-mutation-state': string; - 'react/no-find-dom-node': string; - 'react/no-is-mounted': string; - 'react/no-render-return-value': string; - 'react/no-string-refs': string; - 'react/no-unescaped-entities': string; - 'react/no-unknown-property': string; - 'react/react-in-jsx-scope': string; - 'react/require-render-return': string; - 'react/void-dom-elements-no-children': string; -}; -declare const reactPerfRules: { - 'react-perf/jsx-no-jsx-as-prop': string; - 'react-perf/jsx-no-new-array-as-prop': string; - 'react-perf/jsx-no-new-function-as-prop': string; - 'react-perf/jsx-no-new-object-as-prop': string; -}; -declare const treeShakingRules: { - 'tree-shaking/no-side-effects-in-initialization': string; -}; -declare const typescriptRules: { - '@typescript-eslint/adjacent-overload-signatures': string; - '@typescript-eslint/array-type': string; - '@typescript-eslint/ban-ts-comment': string; - '@typescript-eslint/ban-tslint-comment': string; - '@typescript-eslint/ban-types': string; - '@typescript-eslint/consistent-type-definitions': string; - '@typescript-eslint/no-duplicate-enum-values': string; - '@typescript-eslint/no-empty-interface': string; - '@typescript-eslint/no-explicit-any': string; - '@typescript-eslint/no-extra-non-null-assertion': string; - '@typescript-eslint/no-misused-new': string; - '@typescript-eslint/no-namespace': string; - '@typescript-eslint/no-non-null-asserted-optional-chain': string; - '@typescript-eslint/no-this-alias': string; - '@typescript-eslint/no-unnecessary-type-constraint': string; - '@typescript-eslint/no-unsafe-declaration-merging': string; - '@typescript-eslint/no-var-requires': string; - '@typescript-eslint/prefer-as-const': string; - '@typescript-eslint/prefer-for-of': string; - '@typescript-eslint/prefer-function-type': string; - '@typescript-eslint/prefer-ts-expect-error': string; - '@typescript-eslint/triple-slash-reference': string; -}; -declare const unicornRules: { - 'unicorn/catch-error-name': string; - 'unicorn/empty-brace-spaces': string; - 'unicorn/error-message': string; - 'unicorn/escape-case': string; - 'unicorn/explicit-length-check': string; - 'unicorn/filename-case': string; - 'unicorn/new-for-builtins': string; - 'unicorn/no-abusive-eslint-disable': string; - 'unicorn/no-array-for-each': string; - 'unicorn/no-array-reduce': string; - 'unicorn/no-await-expression-member': string; - 'unicorn/no-await-in-promise-methods': string; - 'unicorn/no-console-spaces': string; - 'unicorn/no-document-cookie': string; - 'unicorn/no-empty-file': string; - 'unicorn/no-hex-escape': string; - 'unicorn/no-instanceof-array': string; - 'unicorn/no-invalid-remove-event-listener': string; - 'unicorn/no-lonely-if': string; - 'unicorn/no-negated-condition': string; - 'unicorn/no-nested-ternary': string; - 'unicorn/no-new-array': string; - 'unicorn/no-new-buffer': string; - 'unicorn/no-null': string; - 'unicorn/no-object-as-default-parameter': string; - 'unicorn/no-process-exit': string; - 'unicorn/no-single-promise-in-promise-methods': string; - 'unicorn/no-static-only-class': string; - 'unicorn/no-thenable': string; - 'unicorn/no-this-assignment': string; - 'unicorn/no-typeof-undefined': string; - 'unicorn/no-unnecessary-await': string; - 'unicorn/no-unreadable-array-destructuring': string; - 'unicorn/no-unreadable-iife': string; - 'unicorn/no-useless-fallback-in-spread': string; - 'unicorn/no-useless-length-check': string; - 'unicorn/no-useless-promise-resolve-reject': string; - 'unicorn/no-useless-spread': string; - 'unicorn/no-useless-switch-case': string; - 'unicorn/no-zero-fractions': string; - 'unicorn/number-literal-case': string; - 'unicorn/numeric-separators-style': string; - 'unicorn/prefer-add-event-listener': string; - 'unicorn/prefer-array-flat': string; - 'unicorn/prefer-array-flat-map': string; - 'unicorn/prefer-array-some': string; - 'unicorn/prefer-blob-reading-methods': string; - 'unicorn/prefer-code-point': string; - 'unicorn/prefer-date-now': string; - 'unicorn/prefer-dom-node-append': string; - 'unicorn/prefer-dom-node-dataset': string; - 'unicorn/prefer-dom-node-remove': string; - 'unicorn/prefer-dom-node-text-content': string; - 'unicorn/prefer-event-target': string; - 'unicorn/prefer-includes': string; - 'unicorn/prefer-logical-operator-over-ternary': string; - 'unicorn/prefer-math-trunc': string; - 'unicorn/prefer-modern-dom-apis': string; - 'unicorn/prefer-modern-math-apis': string; - 'unicorn/prefer-native-coercion-functions': string; - 'unicorn/prefer-node-protocol': string; - 'unicorn/prefer-number-properties': string; - 'unicorn/prefer-optional-catch-binding': string; - 'unicorn/prefer-prototype-methods': string; - 'unicorn/prefer-query-selector': string; - 'unicorn/prefer-reflect-apply': string; - 'unicorn/prefer-regexp-test': string; - 'unicorn/prefer-set-size': string; - 'unicorn/prefer-spread': string; - 'unicorn/prefer-string-replace-all': string; - 'unicorn/prefer-string-slice': string; - 'unicorn/prefer-string-starts-ends-with': string; - 'unicorn/prefer-string-trim-start-end': string; - 'unicorn/prefer-type-error': string; - 'unicorn/require-array-join-separator': string; - 'unicorn/require-number-to-fixed-digits-argument': string; - 'unicorn/switch-case-braces': string; - 'unicorn/text-encoding-identifier-case': string; - 'unicorn/throw-new-error': string; -}; -export { - eslintRules, - importRules, - jestRules, - jsdocRules, - jsxA11yRules, - nextjsRules, - reactRules, - reactPerfRules, - treeShakingRules, - typescriptRules, - unicornRules, -}; diff --git a/lib/rules-by-scope.mjs b/lib/rules-by-scope.mjs deleted file mode 100644 index 5ee6458..0000000 --- a/lib/rules-by-scope.mjs +++ /dev/null @@ -1,342 +0,0 @@ -const eslintRules = { - 'array-callback-return': 'off', - 'constructor-super': 'off', - 'default-case-last': 'off', - 'default-param-last': 'off', - eqeqeq: 'off', - 'for-direction': 'off', - 'getter-return': 'off', - 'guard-for-in': 'off', - 'max-lines': 'off', - 'max-params': 'off', - 'no-array-constructor': 'off', - 'no-async-promise-executor': 'off', - 'no-bitwise': 'off', - 'no-caller': 'off', - 'no-case-declarations': 'off', - 'no-class-assign': 'off', - 'no-compare-neg-zero': 'off', - 'no-cond-assign': 'off', - 'no-console': 'off', - 'no-const-assign': 'off', - 'no-constant-binary-expression': 'off', - 'no-constant-condition': 'off', - 'no-continue': 'off', - 'no-control-regex': 'off', - 'no-debugger': 'off', - 'no-delete-var': 'off', - 'no-dupe-class-members': 'off', - 'no-dupe-else-if': 'off', - 'no-dupe-keys': 'off', - 'no-duplicate-case': 'off', - 'no-empty': 'off', - 'no-empty-character-class': 'off', - 'no-empty-pattern': 'off', - 'no-empty-static-block': 'off', - 'no-eq-null': 'off', - 'no-eval': 'off', - 'no-ex-assign': 'off', - 'no-extra-boolean-cast': 'off', - 'no-fallthrough': 'off', - 'no-func-assign': 'off', - 'no-global-assign': 'off', - 'no-import-assign': 'off', - 'no-inner-declarations': 'off', - 'no-irregular-whitespace': 'off', - 'no-iterator': 'off', - 'no-loss-of-precision': 'off', - 'no-mixed-operators': 'off', - 'no-new-symbol': 'off', - 'no-new-wrappers': 'off', - 'no-nonoctal-decimal-escape': 'off', - 'no-obj-calls': 'off', - 'no-proto': 'off', - 'no-prototype-builtins': 'off', - 'no-redeclare': 'off', - 'no-regex-spaces': 'off', - 'no-return-await': 'off', - 'no-script-url': 'off', - 'no-self-assign': 'off', - 'no-self-compare': 'off', - 'no-setter-return': 'off', - 'no-shadow-restricted-names': 'off', - 'no-sparse-arrays': 'off', - 'no-template-curly-in-string': 'off', - 'no-ternary': 'off', - 'no-this-before-super': 'off', - 'no-undef': 'off', - 'no-unsafe-finally': 'off', - 'no-unsafe-negation': 'off', - 'no-unsafe-optional-chaining': 'off', - 'no-unused-labels': 'off', - 'no-unused-private-class-members': 'off', - 'no-useless-catch': 'off', - 'no-useless-escape': 'off', - 'no-useless-rename': 'off', - 'no-var': 'off', - 'no-void': 'off', - 'no-with': 'off', - 'require-yield': 'off', - 'use-isnan': 'off', - 'valid-typeof': 'off', -}; -const importRules = { - 'import/default': 'off', - 'import/export': 'off', - 'import/named': 'off', - 'import/namespace': 'off', - 'import/no-amd': 'off', - 'import/no-cycle': 'off', - 'import/no-default-export': 'off', - 'import/no-deprecated': 'off', - 'import/no-duplicates': 'off', - 'import/no-named-as-default': 'off', - 'import/no-named-as-default-member': 'off', - 'import/no-self-import': 'off', - 'import/no-unused-modules': 'off', -}; -const jestRules = { - 'jest/expect-expect': 'off', - 'jest/max-expects': 'off', - 'jest/no-alias-methods': 'off', - 'jest/no-commented-out-tests': 'off', - 'jest/no-conditional-expect': 'off', - 'jest/no-confusing-set-timeout': 'off', - 'jest/no-deprecated-functions': 'off', - 'jest/no-disabled-tests': 'off', - 'jest/no-done-callback': 'off', - 'jest/no-export': 'off', - 'jest/no-focused-tests': 'off', - 'jest/no-hooks': 'off', - 'jest/no-identical-title': 'off', - 'jest/no-interpolation-in-snapshots': 'off', - 'jest/no-jasmine-globals': 'off', - 'jest/no-mocks-import': 'off', - 'jest/no-restricted-jest-methods': 'off', - 'jest/no-restricted-matchers': 'off', - 'jest/no-standalone-expect': 'off', - 'jest/no-test-prefixes': 'off', - 'jest/no-test-return-statement': 'off', - 'jest/no-untyped-mock-factory': 'off', - 'jest/prefer-called-with': 'off', - 'jest/prefer-comparison-matcher': 'off', - 'jest/prefer-equality-matcher': 'off', - 'jest/prefer-expect-resolves': 'off', - 'jest/prefer-lowercase-title': 'off', - 'jest/prefer-mock-promise-shorthand': 'off', - 'jest/prefer-spy-on': 'off', - 'jest/prefer-strict-equal': 'off', - 'jest/prefer-to-be': 'off', - 'jest/prefer-to-contain': 'off', - 'jest/prefer-to-have-length': 'off', - 'jest/prefer-todo': 'off', - 'jest/require-to-throw-message': 'off', - 'jest/valid-describe-callback': 'off', - 'jest/valid-expect': 'off', - 'jest/valid-title': 'off', -}; -const jsdocRules = { - 'jsdoc/check-access': 'off', - 'jsdoc/check-property-names': 'off', - 'jsdoc/empty-tags': 'off', - 'jsdoc/require-property': 'off', - 'jsdoc/require-property-description': 'off', - 'jsdoc/require-property-name': 'off', - 'jsdoc/require-property-type': 'off', -}; -const jsxA11yRules = { - 'jsx-a11y/alt-text': 'off', - 'jsx-a11y/anchor-has-content': 'off', - 'jsx-a11y/anchor-is-valid': 'off', - 'jsx-a11y/aria-activedescendant-has-tabindex': 'off', - 'jsx-a11y/aria-props': 'off', - 'jsx-a11y/aria-role': 'off', - 'jsx-a11y/aria-unsupported-elements': 'off', - 'jsx-a11y/autocomplete-valid': 'off', - 'jsx-a11y/click-events-have-key-events': 'off', - 'jsx-a11y/heading-has-content': 'off', - 'jsx-a11y/html-has-lang': 'off', - 'jsx-a11y/iframe-has-title': 'off', - 'jsx-a11y/img-redundant-alt': 'off', - 'jsx-a11y/lang': 'off', - 'jsx-a11y/media-has-caption': 'off', - 'jsx-a11y/mouse-events-have-key-events': 'off', - 'jsx-a11y/no-access-key': 'off', - 'jsx-a11y/no-aria-hidden-on-focusable': 'off', - 'jsx-a11y/no-autofocus': 'off', - 'jsx-a11y/no-distracting-elements': 'off', - 'jsx-a11y/no-redundant-roles': 'off', - 'jsx-a11y/prefer-tag-over-role': 'off', - 'jsx-a11y/role-has-required-aria-props': 'off', - 'jsx-a11y/role-supports-aria-props': 'off', - 'jsx-a11y/scope': 'off', - 'jsx-a11y/tabindex-no-positive': 'off', -}; -const nextjsRules = { - 'nextjs/google-font-display': 'off', - 'nextjs/google-font-preconnect': 'off', - 'nextjs/inline-script-id': 'off', - 'nextjs/next-script-for-ga': 'off', - 'nextjs/no-assign-module-variable': 'off', - 'nextjs/no-async-client-component': 'off', - 'nextjs/no-before-interactive-script-outside-document': 'off', - 'nextjs/no-css-tags': 'off', - 'nextjs/no-document-import-in-page': 'off', - 'nextjs/no-head-element': 'off', - 'nextjs/no-head-import-in-document': 'off', - 'nextjs/no-img-element': 'off', - 'nextjs/no-script-component-in-head': 'off', - 'nextjs/no-sync-scripts': 'off', - 'nextjs/no-title-in-document-head': 'off', - 'nextjs/no-typos': 'off', - 'nextjs/no-unwanted-polyfillio': 'off', -}; -const reactRules = { - 'react/button-has-type': 'off', - 'react/checked-requires-onchange-or-readonly': 'off', - 'react/jsx-key': 'off', - 'react/jsx-no-comment-textnodes': 'off', - 'react/jsx-no-duplicate-props': 'off', - 'react/jsx-no-target-blank': 'off', - 'react/jsx-no-undef': 'off', - 'react/jsx-no-useless-fragment': 'off', - 'react/no-children-prop': 'off', - 'react/no-danger': 'off', - 'react/no-direct-mutation-state': 'off', - 'react/no-find-dom-node': 'off', - 'react/no-is-mounted': 'off', - 'react/no-render-return-value': 'off', - 'react/no-string-refs': 'off', - 'react/no-unescaped-entities': 'off', - 'react/no-unknown-property': 'off', - 'react/react-in-jsx-scope': 'off', - 'react/require-render-return': 'off', - 'react/void-dom-elements-no-children': 'off', -}; -const reactPerfRules = { - 'react-perf/jsx-no-jsx-as-prop': 'off', - 'react-perf/jsx-no-new-array-as-prop': 'off', - 'react-perf/jsx-no-new-function-as-prop': 'off', - 'react-perf/jsx-no-new-object-as-prop': 'off', -}; -const treeShakingRules = { - 'tree-shaking/no-side-effects-in-initialization': 'off', -}; -const typescriptRules = { - '@typescript-eslint/adjacent-overload-signatures': 'off', - '@typescript-eslint/array-type': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/ban-tslint-comment': 'off', - '@typescript-eslint/ban-types': 'off', - '@typescript-eslint/consistent-type-definitions': 'off', - '@typescript-eslint/no-duplicate-enum-values': 'off', - '@typescript-eslint/no-empty-interface': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-extra-non-null-assertion': 'off', - '@typescript-eslint/no-misused-new': 'off', - '@typescript-eslint/no-namespace': 'off', - '@typescript-eslint/no-non-null-asserted-optional-chain': 'off', - '@typescript-eslint/no-this-alias': 'off', - '@typescript-eslint/no-unnecessary-type-constraint': 'off', - '@typescript-eslint/no-unsafe-declaration-merging': 'off', - '@typescript-eslint/no-var-requires': 'off', - '@typescript-eslint/prefer-as-const': 'off', - '@typescript-eslint/prefer-for-of': 'off', - '@typescript-eslint/prefer-function-type': 'off', - '@typescript-eslint/prefer-ts-expect-error': 'off', - '@typescript-eslint/triple-slash-reference': 'off', -}; -const unicornRules = { - 'unicorn/catch-error-name': 'off', - 'unicorn/empty-brace-spaces': 'off', - 'unicorn/error-message': 'off', - 'unicorn/escape-case': 'off', - 'unicorn/explicit-length-check': 'off', - 'unicorn/filename-case': 'off', - 'unicorn/new-for-builtins': 'off', - 'unicorn/no-abusive-eslint-disable': 'off', - 'unicorn/no-array-for-each': 'off', - 'unicorn/no-array-reduce': 'off', - 'unicorn/no-await-expression-member': 'off', - 'unicorn/no-await-in-promise-methods': 'off', - 'unicorn/no-console-spaces': 'off', - 'unicorn/no-document-cookie': 'off', - 'unicorn/no-empty-file': 'off', - 'unicorn/no-hex-escape': 'off', - 'unicorn/no-instanceof-array': 'off', - 'unicorn/no-invalid-remove-event-listener': 'off', - 'unicorn/no-lonely-if': 'off', - 'unicorn/no-negated-condition': 'off', - 'unicorn/no-nested-ternary': 'off', - 'unicorn/no-new-array': 'off', - 'unicorn/no-new-buffer': 'off', - 'unicorn/no-null': 'off', - 'unicorn/no-object-as-default-parameter': 'off', - 'unicorn/no-process-exit': 'off', - 'unicorn/no-single-promise-in-promise-methods': 'off', - 'unicorn/no-static-only-class': 'off', - 'unicorn/no-thenable': 'off', - 'unicorn/no-this-assignment': 'off', - 'unicorn/no-typeof-undefined': 'off', - 'unicorn/no-unnecessary-await': 'off', - 'unicorn/no-unreadable-array-destructuring': 'off', - 'unicorn/no-unreadable-iife': 'off', - 'unicorn/no-useless-fallback-in-spread': 'off', - 'unicorn/no-useless-length-check': 'off', - 'unicorn/no-useless-promise-resolve-reject': 'off', - 'unicorn/no-useless-spread': 'off', - 'unicorn/no-useless-switch-case': 'off', - 'unicorn/no-zero-fractions': 'off', - 'unicorn/number-literal-case': 'off', - 'unicorn/numeric-separators-style': 'off', - 'unicorn/prefer-add-event-listener': 'off', - 'unicorn/prefer-array-flat': 'off', - 'unicorn/prefer-array-flat-map': 'off', - 'unicorn/prefer-array-some': 'off', - 'unicorn/prefer-blob-reading-methods': 'off', - 'unicorn/prefer-code-point': 'off', - 'unicorn/prefer-date-now': 'off', - 'unicorn/prefer-dom-node-append': 'off', - 'unicorn/prefer-dom-node-dataset': 'off', - 'unicorn/prefer-dom-node-remove': 'off', - 'unicorn/prefer-dom-node-text-content': 'off', - 'unicorn/prefer-event-target': 'off', - 'unicorn/prefer-includes': 'off', - 'unicorn/prefer-logical-operator-over-ternary': 'off', - 'unicorn/prefer-math-trunc': 'off', - 'unicorn/prefer-modern-dom-apis': 'off', - 'unicorn/prefer-modern-math-apis': 'off', - 'unicorn/prefer-native-coercion-functions': 'off', - 'unicorn/prefer-node-protocol': 'off', - 'unicorn/prefer-number-properties': 'off', - 'unicorn/prefer-optional-catch-binding': 'off', - 'unicorn/prefer-prototype-methods': 'off', - 'unicorn/prefer-query-selector': 'off', - 'unicorn/prefer-reflect-apply': 'off', - 'unicorn/prefer-regexp-test': 'off', - 'unicorn/prefer-set-size': 'off', - 'unicorn/prefer-spread': 'off', - 'unicorn/prefer-string-replace-all': 'off', - 'unicorn/prefer-string-slice': 'off', - 'unicorn/prefer-string-starts-ends-with': 'off', - 'unicorn/prefer-string-trim-start-end': 'off', - 'unicorn/prefer-type-error': 'off', - 'unicorn/require-array-join-separator': 'off', - 'unicorn/require-number-to-fixed-digits-argument': 'off', - 'unicorn/switch-case-braces': 'off', - 'unicorn/text-encoding-identifier-case': 'off', - 'unicorn/throw-new-error': 'off', -}; -export { - eslintRules, - importRules, - jestRules, - jsdocRules, - jsxA11yRules, - nextjsRules, - reactPerfRules, - reactRules, - treeShakingRules, - typescriptRules, - unicornRules, -}; diff --git a/lib/utils.cjs b/lib/utils.cjs deleted file mode 100644 index 068d6f2..0000000 --- a/lib/utils.cjs +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -function createFlatRulesConfig(rulesModule) { - const flatRulesConfig = {}; - for (const key of Object.keys(rulesModule)) { - if (key.endsWith('Rules')) { - const flatKey = `flat/${key.replace('Rules', '')}`; - flatRulesConfig[flatKey] = { rules: rulesModule[key] }; - } - } - return flatRulesConfig; -} -exports.createFlatRulesConfig = createFlatRulesConfig; diff --git a/lib/utils.d.ts b/lib/utils.d.ts deleted file mode 100644 index 810afc5..0000000 --- a/lib/utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare function createFlatRulesConfig(rulesModule: { - [key: string]: unknown; -}): { - [key: string]: unknown; -}; diff --git a/lib/utils.mjs b/lib/utils.mjs deleted file mode 100644 index 97cae74..0000000 --- a/lib/utils.mjs +++ /dev/null @@ -1,11 +0,0 @@ -function createFlatRulesConfig(rulesModule) { - const flatRulesConfig = {}; - for (const key of Object.keys(rulesModule)) { - if (key.endsWith('Rules')) { - const flatKey = `flat/${key.replace('Rules', '')}`; - flatRulesConfig[flatKey] = { rules: rulesModule[key] }; - } - } - return flatRulesConfig; -} -export { createFlatRulesConfig }; diff --git a/package.json b/package.json index 1f935bd..ac14452 100644 --- a/package.json +++ b/package.json @@ -6,26 +6,26 @@ "packageManager": "pnpm@9.12.0", "exports": { ".": { - "types": "./lib/index.d.ts", - "import": "./lib/index.mjs", - "require": "./lib/index.cjs", - "default": "./lib/index.mjs" + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" }, "./rules-by-category": { - "types": "./lib/rules-by-category.d.ts", - "import": "./lib/rules-by-category.mjs", - "require": "./lib/rules-by-category.cjs", - "default": "./lib/rules-by-category.mjs" + "types": "./dist/rules-by-category.d.ts", + "import": "./dist/rules-by-category.mjs", + "require": "./dist/rules-by-category.cjs", + "default": "./dist/rules-by-category.mjs" }, "./rules-by-scope": { - "types": "./lib/rules-by-scope.d.ts", - "import": "./lib/rules-by-scope.mjs", - "require": "./lib/rules-by-scope.cjs", - "default": "./lib/rules-by-scope.mjs" + "types": "./dist/rules-by-scope.d.ts", + "import": "./dist/rules-by-scope.mjs", + "require": "./dist/rules-by-scope.cjs", + "default": "./dist/rules-by-scope.mjs" } }, "files": [ - "lib", + "dist", "src" ], "author": "Dunqing ", diff --git a/tsconfig.json b/tsconfig.json index 4c1d018..ec0c48a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -98,5 +98,5 @@ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, - "exclude": ["lib"] + "exclude": ["dist"] } diff --git a/vite.config.ts b/vite.config.ts index 1889c7a..43fef22 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -23,7 +23,6 @@ export default defineConfig({ preserveModules: true, }, }, - outDir: 'lib', minify: false, }, plugins: [