eslint.config.js•1.2 kB
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
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',
exports: 'writable',
global: 'readonly',
module: 'writable',
require: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
},
rules: {
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off', // relaxed
'@typescript-eslint/no-non-null-assertion': 'error',
'prefer-const': 'error',
'no-var': 'error',
'complexity': ['warn', 15], // relaxed
'max-lines-per-function': ['warn', 80], // relaxed
'max-depth': ['warn', 4],
},
},
];