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.
54 lines
1.8 KiB
54 lines
1.8 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 stylistic from '@stylistic/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',
|
|
),
|
|
stylistic.configs['recommended-flat'],
|
|
{
|
|
files: ['src/**/*.ts', 'test/**/*.ts'],
|
|
languageOptions: { parser },
|
|
plugins: {
|
|
'@typescript-eslint': ts,
|
|
'@stylistic': stylistic,
|
|
},
|
|
rules: {
|
|
'arrow-body-style': 'error',
|
|
'no-extra-parens': ['error', 'all'],
|
|
'no-unexpected-multiline': 'off',
|
|
'sort-imports': ['error', { ignoreDeclarationSort: true }],
|
|
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
|
'@stylistic/quotes': ['error', 'single'],
|
|
'@stylistic/semi': ['error', 'always'],
|
|
'@stylistic/indent': 'error',
|
|
'@stylistic/arrow-parens': ['error', 'as-needed', { requireForBlockBody: false }],
|
|
'@stylistic/max-statements-per-line': 'off',
|
|
'@stylistic/member-delimiter-style': 'error',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
args: 'all',
|
|
argsIgnorePattern: '^_',
|
|
caughtErrors: 'all',
|
|
caughtErrorsIgnorePattern: '^_',
|
|
destructuredArrayIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
ignoreRestSiblings: true,
|
|
},
|
|
],
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
},
|
|
}]
|
|
|