eslint.config.js•1.21 kB
import js from '@eslint/js';
import ts from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import prettierConfig from 'eslint-config-prettier';
export default [
js.configs.recommended,
{
files: ['**/*.ts'],
ignores: ['build/**', 'node_modules/**'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
console: 'readonly',
process: 'readonly',
describe: 'readonly',
it: 'readonly',
expect: 'readonly',
jest: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
},
},
plugins: {
'@typescript-eslint': ts,
},
rules: {
...ts.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }],
},
},
prettierConfig,
{
files: ['**/__tests__/**/*.ts'],
rules: {
'no-import-assign': 'off', // Allow modifying imports for mocking
'@typescript-eslint/no-explicit-any': 'off', // Allow any in tests for mocking
}
},
];