import { defineConfig } from 'eslint/config';
import strictConfig from './eslint.config.js';
export default defineConfig(...strictConfig, {
// temporarily disable failing rules so lint in CI passes
// number of errors/warnings per rule recorded at Fri Jul 19 2024 12:05:59 GMT+0200 (Central European Summer Time)
rules: {
'arrow-body-style': 'off', // 9 warnings
eqeqeq: 'off', // 57 errors
'max-lines': 'off', // 8 warnings
'max-lines-per-function': 'off', // 18 warnings
'max-nested-callbacks': 'off', // 1 warning
'no-async-promise-executor': 'off', // 3 errors
'no-console': 'off', // 156 warnings
'no-constant-condition': 'off', // 6 errors
'no-dupe-keys': 'off', // 1 error
'no-duplicate-imports': 'off', // 1 warning
'no-global-assign': 'off', // 4 errors
'no-param-reassign': 'off', // 93 errors
'no-prototype-builtins': 'off', // 2 errors
'no-sequences': 'off', // 1 error
'no-undef': 'off', // 4 errors
'no-undef-init': 'off', // 5 warnings
'prefer-const': 'off', // 31 errors
'prefer-template': 'off', // 36 warnings
radix: 'off', // 40 warnings
'@typescript-eslint/class-methods-use-this': 'off', // 4 warnings
'@typescript-eslint/consistent-type-definitions': 'off', // 4 warnings
'@typescript-eslint/max-params': 'off', // 11 warnings
'@typescript-eslint/naming-convention': 'off', // 7 warnings
'@typescript-eslint/no-confusing-void-expression': 'off', // 3 warnings
'@typescript-eslint/no-explicit-any': 'off', // 6 errors
'@typescript-eslint/no-floating-promises': 'off', // 6 errors
'@typescript-eslint/no-shadow': 'off', // 104 warnings
'@typescript-eslint/no-this-alias': 'off', // 1 error
'@typescript-eslint/no-unnecessary-condition': 'off', // 16 warnings
'@typescript-eslint/no-unsafe-argument': 'off', // 61 errors
'@typescript-eslint/no-unsafe-assignment': 'off', // 282 errors
'@typescript-eslint/no-unsafe-call': 'off', // 159 errors
'@typescript-eslint/no-unsafe-member-access': 'off', // 507 errors
'@typescript-eslint/no-unsafe-return': 'off', // 42 errors
'@typescript-eslint/no-unused-expressions': 'off', // 17 warnings
'@typescript-eslint/no-unused-vars': 'off', // 101 errors
'@typescript-eslint/only-throw-error': 'off', // 5 errors
'@typescript-eslint/require-await': 'off', // 3 errors
'@typescript-eslint/restrict-plus-operands': 'off', // 31 errors
'deprecation/deprecation': 'off', // 1 error
'functional/immutable-data': 'off', // 140 errors
'functional/no-let': 'off', // 78 warnings
'functional/no-loop-statements': 'off', // 57 warnings
'functional/prefer-tacit': 'off', // 2 warnings
'import/default': 'off', // 1 error
'import/extensions': 'off', // 9 warnings
'import/namespace': 'off', // 11 errors
'import/no-duplicates': 'off', // 4 warnings
'import/no-named-as-default': 'off', // 1 warning
'import/no-unassigned-import': 'off', // 1 warning
'import/no-unresolved': 'off', // 2 errors
'promise/catch-or-return': 'off', // 4 errors
'sonarjs/cognitive-complexity': 'off', // 2 errors
'sonarjs/no-collapsible-if': 'off', // 7 errors
'sonarjs/no-duplicate-string': 'off', // 24 warnings
'sonarjs/no-extra-arguments': 'off', // 3 errors
'sonarjs/no-gratuitous-expressions': 'off', // 1 error
'sonarjs/no-identical-expressions': 'off', // 2 errors
'sonarjs/no-redundant-boolean': 'off', // 2 errors
'sonarjs/no-use-of-empty-return-value': 'off', // 1 error
'sonarjs/prefer-immediate-return': 'off', // 5 warnings
'svelte/no-unused-svelte-ignore': 'off', // 1 error
'svelte/valid-compile': 'off', // 11 errors
'turbo/no-undeclared-env-vars': 'off', // 2 errors
'unicorn/catch-error-name': 'off', // 13 warnings
'unicorn/explicit-length-check': 'off', // 1 warning
'unicorn/filename-case': 'off', // 2 warnings
'unicorn/new-for-builtins': 'off', // 2 warnings
'unicorn/no-array-push-push': 'off', // 2 warnings
'unicorn/no-for-loop': 'off', // 4 warnings
'unicorn/no-lonely-if': 'off', // 7 warnings
'unicorn/no-negated-condition': 'off', // 4 warnings
'unicorn/no-new-array': 'off', // 4 warnings
'unicorn/no-this-assignment': 'off', // 1 warning
'unicorn/no-useless-undefined': 'off', // 7 warnings
'unicorn/no-zero-fractions': 'off', // 72 warnings
'unicorn/numeric-separators-style': 'off', // 58 warnings
'unicorn/prefer-add-event-listener': 'off', // 28 warnings
'unicorn/prefer-array-some': 'off', // 2 warnings
'unicorn/prefer-at': 'off', // 1 warning
'unicorn/prefer-blob-reading-methods': 'off', // 3 warnings
'unicorn/prefer-code-point': 'off', // 4 warnings
'unicorn/prefer-date-now': 'off', // 4 warnings
'unicorn/prefer-dom-node-append': 'off', // 1 warning
'unicorn/prefer-modern-math-apis': 'off', // 4 warnings
'unicorn/prefer-native-coercion-functions': 'off', // 1 warning
'unicorn/prefer-node-protocol': 'off', // 4 warnings
'unicorn/prefer-number-properties': 'off', // 104 warnings
'unicorn/prefer-optional-catch-binding': 'off', // 7 warnings
'unicorn/prefer-regexp-test': 'off', // 5 warnings
'unicorn/prefer-set-has': 'off', // 1 warning
'unicorn/prefer-spread': 'off', // 3 warnings
'unicorn/prefer-string-slice': 'off', // 7 warnings
'unicorn/prefer-switch': 'off', // 2 warnings
'unicorn/prefer-ternary': 'off', // 5 warnings
'unicorn/prefer-top-level-await': 'off', // 1 warning
},
});
User story
The main advantage of integrating
@code-pushup/eslint-pluginis that it allows setting a strict aspirationaleslint.config.js, even though the current codebase isn't prepared to meet those standards. This can be set up with 2 ESLint configs - 1 strict config for Code PushUp (and IDEs), 1 derived config that disables failing rules for an existing CI job. This facilitates incremental improvements over a longer period of time, with progress being tracked and no blocking CI.Since this config splitting is both deterministic and cumbersome to do manually, it would be very useful if the setup wizard could automate this process when setting up the ESLint plugin.
Real-world example
eslint.config.jseslint.config.ci.jsImplementation notes
We used to have a helper script that automated the ESLint configs transformation, including running ESLint to collect all failing rules. The script only works with the legacy config format, but may still serve as inspiration.
eslint-to-code-pushup.mjsAcceptance criteria
eslintwith the provided config.