- Upgrades eslint from v8 to v9 - Upgrades all other eslint packages. We will have to do a new full-project lint, as new rules have been added - Upgrades husky from v8 to v9 - Upgrades lint-staged from v14 to v15 - Moves the old .eslintrc.cjs file format to the new eslint.config.js flat file format. Previously, we were very specific regarding which rules are applied to which files. Now that `extends` is no longer a thing, I have to use deepMerge & imports instead. This is rather uncommon and is not a documented pattern - e.g. typescript-eslint docs want us to add the default typescript-eslint rules to the top-level & then disable it in files using the disable-typechecked config. However, I hate this opt-out approach. The way I did it here adds a lot of clarity as to which rules are applied to which files, and is pretty easy to read. Much less black magic ## .eslintignore These files are no longer supported (see https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files). I moved the entries to the ignores property in the eslint config. => one less file in each package folder!
41 lines
1.4 KiB
JavaScript
41 lines
1.4 KiB
JavaScript
/** @type {import('eslint').Linter.FlatConfig} */
|
|
export const index = {
|
|
rules: {
|
|
'jest/consistent-test-it': ['error', { fn: 'it' }],
|
|
'jest/expect-expect': 'error',
|
|
'jest/prefer-lowercase-title': ['error', { ignore: ['describe'] }],
|
|
'jest/no-alias-methods': 'error',
|
|
'jest/no-commented-out-tests': 'off',
|
|
'jest/no-disabled-tests': 'off',
|
|
'jest/no-duplicate-hooks': 'error',
|
|
'jest/no-export': 'error',
|
|
'jest/no-focused-tests': 'error',
|
|
'jest/no-hooks': 'off',
|
|
'jest/no-identical-title': 'error',
|
|
'jest/no-conditional-in-test': 'error',
|
|
'jest/no-jasmine-globals': 'error',
|
|
'jest/no-large-snapshots': 'error',
|
|
'jest/no-mocks-import': 'error',
|
|
'jest/no-standalone-expect': 'error',
|
|
'jest/no-done-callback': 'error',
|
|
'jest/no-test-prefixes': 'error',
|
|
'jest/no-test-return-statement': 'error',
|
|
'jest/prefer-called-with': 'error',
|
|
'jest/prefer-expect-assertions': 'off',
|
|
'jest/prefer-hooks-on-top': 'error',
|
|
'jest/prefer-spy-on': 'error',
|
|
'jest/prefer-strict-equal': 'error',
|
|
'jest/prefer-to-contain': 'error',
|
|
'jest/prefer-to-have-length': 'error',
|
|
'jest/prefer-todo': 'error',
|
|
'jest/require-top-level-describe': 'error',
|
|
'jest/require-to-throw-message': 'error',
|
|
'jest/valid-describe-callback': 'error',
|
|
'jest/valid-expect-in-promise': 'error',
|
|
'jest/valid-expect': 'error',
|
|
'jest/valid-title': 'error',
|
|
},
|
|
}
|
|
|
|
export default index
|