Migración desde workspace-v2/projects/template-saas/apps/backend Este repositorio es parte del estándar multi-repo v2 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
72 lines
2.0 KiB
JavaScript
72 lines
2.0 KiB
JavaScript
import globals from 'globals';
|
|
import tseslint from '@typescript-eslint/eslint-plugin';
|
|
import tsparser from '@typescript-eslint/parser';
|
|
|
|
export default [
|
|
// Source files - stricter rules
|
|
{
|
|
files: ['src/**/*.ts'],
|
|
languageOptions: {
|
|
parser: tsparser,
|
|
parserOptions: {
|
|
project: './tsconfig.json',
|
|
tsconfigRootDir: import.meta.dirname,
|
|
sourceType: 'module',
|
|
},
|
|
globals: {
|
|
...globals.node,
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tseslint,
|
|
},
|
|
rules: {
|
|
...tseslint.configs.recommended.rules,
|
|
'@typescript-eslint/no-unused-vars': ['warn', {
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
caughtErrorsIgnorePattern: '^_',
|
|
destructuredArrayIgnorePattern: '^_',
|
|
ignoreRestSiblings: true,
|
|
}],
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
'@typescript-eslint/no-empty-function': 'warn',
|
|
'@typescript-eslint/no-inferrable-types': 'off',
|
|
'@typescript-eslint/no-require-imports': 'off',
|
|
'no-console': 'off',
|
|
'prefer-const': 'error',
|
|
},
|
|
},
|
|
// Test files - relaxed rules
|
|
{
|
|
files: ['__tests__/**/*.ts', 'src/**/*.spec.ts', 'src/**/*.test.ts'],
|
|
languageOptions: {
|
|
parser: tsparser,
|
|
parserOptions: {
|
|
project: './tsconfig.json',
|
|
tsconfigRootDir: import.meta.dirname,
|
|
sourceType: 'module',
|
|
},
|
|
globals: {
|
|
...globals.node,
|
|
...globals.jest,
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tseslint,
|
|
},
|
|
rules: {
|
|
...tseslint.configs.recommended.rules,
|
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/no-empty-function': 'off',
|
|
'no-console': 'off',
|
|
},
|
|
},
|
|
{
|
|
ignores: ['dist/**', 'node_modules/**', 'coverage/**', '*.js', '*.mjs'],
|
|
},
|
|
];
|