eslint.config.js•1.5 kB
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
export default [
{
files: ['src/**/*.ts'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2023,
sourceType: 'module'
},
globals: {
process: 'readonly',
console: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly'
}
},
plugins: {
'@typescript-eslint': tseslint
},
rules: {
'no-console': 'warn',
'no-debugger': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { 'argsIgnorePattern': '^_' }],
'@typescript-eslint/no-explicit-any': 'warn'
}
},
{
files: ['src/**/*.test.ts', 'src/__tests__/**/*.ts'],
languageOptions: {
parser: tsparser,
globals: {
process: 'readonly',
console: 'readonly',
describe: 'readonly',
test: 'readonly',
it: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
jest: 'readonly'
}
},
plugins: {
'@typescript-eslint': tseslint
},
rules: {
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off'
}
},
{
ignores: ['build/', 'node_modules/', '*.js', '!eslint.config.js']
}
];