1
0
Fork 0
mirror of https://github.com/dorny/test-reporter.git synced 2026-03-21 23:52:12 +01:00

Modernize ESLint configuration

This commit is contained in:
Jozef Izso 2026-03-02 17:15:02 +01:00
parent 393efa337c
commit eed2d2d031
Failed to extract signature
8 changed files with 86 additions and 121 deletions

View file

@ -4,32 +4,58 @@ import jest from 'eslint-plugin-jest'
export default [
github.getFlatConfigs().recommended,
...github.getFlatConfigs().typescript,
{
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import/resolver': {
typescript: {
project: './tsconfig.json',
alwaysTryTypes: true
},
node: {
extensions: ['.js', '.mjs', '.ts', '.tsx']
}
}
}
},
{
files: ['src/**/*.ts'],
rules: {
'no-shadow': 'off',
'import/no-namespace': 'off',
'i18n-text/no-en': 'off',
'eslint-comments/no-use': 'off',
'import/no-namespace': 'off',
'import/no-named-as-default': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'prefer-template': 'off',
"@typescript-eslint/array-type": ['error', {default: 'array'}],
camelcase: 'off',
semi: 'off',
'@typescript-eslint/array-type': ['error', {default: 'array'}],
'@typescript-eslint/no-unused-vars': ['error', {varsIgnorePattern: '^_'}],
'@typescript-eslint/no-shadow': ['error'],
},
// Modern replacements for deprecated rules from the legacy config.
'@typescript-eslint/no-empty-object-type': 'error',
'@typescript-eslint/no-require-imports': 'error'
}
},
{
files: ['__tests__/**/*.test.ts'],
...jest.configs['flat/recommended'],
plugins: {
jest,
jest
},
languageOptions: {
globals: jest.environments.globals.globals,
globals: jest.environments.globals.globals
},
rules: {
'i18n-text/no-en': 'off',
'import/no-namespace': 'off',
"@typescript-eslint/array-type": ['error', {default: 'array'}],
},
'@typescript-eslint/array-type': ['error', {default: 'array'}],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off'
}
},
{
ignores: [
@ -41,7 +67,7 @@ export default [
'assets/**',
'reports/**',
'eslint.config.mjs',
'jest.config.cjs',
],
},
'jest.config.cjs'
]
}
]