You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
43 lines
1.3 KiB
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { FlatCompat } from '@eslint/eslintrc';
|
|
import js from '@eslint/js';
|
|
import ts from '@typescript-eslint/eslint-plugin';
|
|
import parser from '@typescript-eslint/parser';
|
|
|
|
export default [
|
|
...new FlatCompat({
|
|
baseDirectory: path.dirname(fileURLToPath(import.meta.url)),
|
|
recommendedConfig: js.configs.recommended,
|
|
allConfig: js.configs.all,
|
|
})
|
|
.extends(
|
|
'eslint:recommended',
|
|
'plugin:@typescript-eslint/eslint-recommended',
|
|
'plugin:@typescript-eslint/recommended',
|
|
),
|
|
{
|
|
files: ['src/**/*.ts', 'test/**/*.ts'],
|
|
languageOptions: { parser },
|
|
plugins: {
|
|
'@typescript-eslint': ts,
|
|
},
|
|
rules: {
|
|
'arrow-body-style': 'error',
|
|
'no-extra-parens': ['error', 'all'],
|
|
'sort-imports': ['error', { ignoreDeclarationSort: true }],
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
'args': 'all',
|
|
'argsIgnorePattern': '^_',
|
|
'caughtErrors': 'all',
|
|
'caughtErrorsIgnorePattern': '^_',
|
|
'destructuredArrayIgnorePattern': '^_',
|
|
'varsIgnorePattern': '^_',
|
|
'ignoreRestSiblings': true
|
|
}
|
|
],
|
|
'@typescript-eslint/no-explicit-any': 'off'
|
|
}
|
|
}];
|
|
|