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'], 'sort-imports': ['error', { ignoreDeclarationSort: true }], '@stylistic/quotes': ['error', 'single'], '@stylistic/semi': ['error', 'always'], '@stylistic/indent': 'error', '@stylistic/arrow-parens': ['error', 'as-needed', { requireForBlockBody: false }], '@typescript-eslint/no-unused-vars': [ 'error', { args: 'all', argsIgnorePattern: '^_', caughtErrors: 'all', caughtErrorsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_', varsIgnorePattern: '^_', ignoreRestSiblings: true, }, ], '@typescript-eslint/no-explicit-any': 'off', }, }]