41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
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';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const tsconfigRootDir = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default [
|
|
{
|
|
ignores: ['dist/**', 'node_modules/**', 'server', '*.js'],
|
|
},
|
|
{
|
|
files: ['static/**/*.ts'],
|
|
plugins: {
|
|
'@typescript-eslint': tseslint,
|
|
prettier,
|
|
},
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
project: ['./tsconfig.json'],
|
|
tsconfigRootDir,
|
|
},
|
|
},
|
|
rules: {
|
|
...eslintConfigPrettier.rules,
|
|
...tseslint.configs.recommended.rules,
|
|
...tseslint.configs.stylistic.rules,
|
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
|
|
],
|
|
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
|
|
'prettier/prettier': 'error',
|
|
},
|
|
},
|
|
];
|