45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
import js from '@eslint/js';
|
|
import typescript from '@typescript-eslint/eslint-plugin';
|
|
import typescriptParser from '@typescript-eslint/parser';
|
|
import prettier from 'eslint-plugin-prettier';
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
languageOptions: {
|
|
parser: typescriptParser,
|
|
parserOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
project: './tsconfig.json',
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': typescript,
|
|
prettier: prettier,
|
|
},
|
|
rules: {
|
|
...typescript.configs.recommended.rules,
|
|
...typescript.configs['recommended-requiring-type-checking'].rules,
|
|
'prettier/prettier': 'error',
|
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/prefer-const': 'error',
|
|
'@typescript-eslint/no-var-requires': 'error',
|
|
'no-console': 'off', // Allow console for server logging
|
|
'prefer-const': 'error',
|
|
'no-var': 'error',
|
|
'object-shorthand': 'error',
|
|
'prefer-template': 'error',
|
|
},
|
|
ignores: [
|
|
'node_modules/**',
|
|
'dist/**',
|
|
'*.js',
|
|
'*.mjs',
|
|
'eslint.config.js'
|
|
],
|
|
},
|
|
]; |