eslint.config.js•1.77 kB
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettierConfig from 'eslint-config-prettier';
import { defineConfig } from 'eslint/config';
export default defineConfig([
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{
languageOptions: {
globals: { ...globals.browser, ...globals.node },
ecmaVersion: 2022,
sourceType: 'module',
},
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
prettierConfig,
{
rules: {
// Error prevention
'no-console': 'warn',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'prefer-const': 'error',
'no-var': 'error',
eqeqeq: 'error',
'no-duplicate-imports': 'error',
'no-param-reassign': 'error',
'no-return-await': 'error',
'prefer-template': 'warn',
'no-unneeded-ternary': 'warn',
// TypeScript specific
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/consistent-type-imports': ['warn', { prefer: 'type-imports' }],
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-ignore': 'allow-with-description',
minimumDescriptionLength: 10,
},
],
},
},
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/build/**',
'**/coverage/**',
'src/utils/**',
'utils/**',
'**/test/**',
'**/assets/**',
'**/.github/**',
'.eslintrc.js',
],
},
]);