eslint.config.js•1.5 kB
import eslint from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import prettier from 'eslint-plugin-prettier';
import eslintConfigPrettier from 'eslint-config-prettier';
export default [
eslint.configs.recommended,
{
ignores: ['**/dist/**', '**/build/**'],
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
globals: {
console: 'readonly',
process: 'readonly',
global: 'readonly',
fetch: 'readonly',
URLSearchParams: 'readonly',
require: 'readonly',
exports: 'readonly',
module: 'readonly',
setTimeout: 'readonly',
// Jest globals
describe: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
it: 'readonly',
expect: 'readonly',
jest: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
prettier: prettier,
},
rules: {
...tseslint.configs.recommended.rules,
...eslintConfigPrettier.rules,
'prettier/prettier': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-undef': 'error',
},
},
];