eslint.config.js•2.42 kB
import typescript from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import prettier from 'eslint-plugin-prettier';
import globals from 'globals';
export default [
{
ignores: ['node_modules/**', 'dist/**', '**/*.d.ts'],
},
{
files: ['**/*.config.js', '**/*.config.ts'],
languageOptions: {
parser: typescriptParser,
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
},
},
plugins: {
'@typescript-eslint': typescript,
prettier,
},
rules: {
...typescript.configs.recommended.rules,
'prettier/prettier': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'no-console': 'off',
'prefer-const': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-arrow-callback': 'error',
},
},
{
files: ['src/**/*.ts'],
languageOptions: {
parser: typescriptParser,
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
},
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'@typescript-eslint': typescript,
prettier,
},
rules: {
...typescript.configs.recommended.rules,
'prettier/prettier': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/prefer-optional-chain': 'warn',
'@typescript-eslint/no-unnecessary-condition': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/require-await': 'warn',
'no-console': 'off', // Allow console in MCP server
'prefer-const': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-arrow-callback': 'error',
},
},
];