eslint.config.js•1.75 kB
import js from '@eslint/js'
import tsEslint from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import nodePlugin from 'eslint-plugin-node'
import security from 'eslint-plugin-security'
export default [
js.configs.recommended,
{
files: ['src/**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.json',
},
globals: {
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
fetch: 'readonly',
},
},
plugins: {
'@typescript-eslint': tsEslint,
security,
node: nodePlugin,
},
rules: {
// Basic ESLint rules
'no-unused-vars': 'off', // Handled by TypeScript
'no-console': 'off', // Allow console for server logging
// Security rules
'security/detect-object-injection': 'error',
'security/detect-non-literal-regexp': 'error',
// TypeScript specific
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
}],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
// Formatting (disabled to avoid conflict with dprint)
'indent': 'off',
'quotes': 'off',
'semi': 'off',
'comma-dangle': 'off',
},
},
{
ignores: [
'node_modules/',
'dist/',
'build/',
'*.config.js',
'*.config.ts',
'.env*',
'coverage/',
'*.log',
],
},
]