import { FlatCompat } from '@eslint/eslintrc' import js from '@eslint/js' import stylistic from '@stylistic/eslint-plugin' import stylisticts from '@stylistic/eslint-plugin-ts' import ts from '@typescript-eslint/eslint-plugin' import parser from '@typescript-eslint/parser' import path from 'node:path' import { fileURLToPath } from 'node:url' 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, '@stylistic/ts': stylisticts, }, 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/ts/semi': ['error', 'always'], '@stylistic/indent': 'error', '@stylistic/arrow-parens': ['error', 'as-needed', { requireForBlockBody: false }], '@stylistic/max-statements-per-line': 'off', '@stylistic/member-delimiter-style': 'off', '@stylistic/ts/member-delimiter-style': 'error', '@stylistic/no-mixed-operators': 'off', '@typescript-eslint/no-unused-vars': [ 'error', { args: 'all', argsIgnorePattern: '^_', caughtErrors: 'all', caughtErrorsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_', varsIgnorePattern: '^_', ignoreRestSiblings: true, }, ], '@typescript-eslint/no-explicit-any': 'off', }, }]