Skip to content

Commit 3f416f9

Browse files
author
Antonella Sgarlatta
committed
chore: add eslint config file
1 parent 6e4042c commit 3f416f9

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

eslint.config.js

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
const tseslint = require('typescript-eslint')
2+
3+
module.exports = [
4+
// JavaScript files (including jest configs)
5+
{
6+
files: ['**/*.{js,mjs,cjs}'],
7+
languageOptions: {
8+
ecmaVersion: 2022,
9+
sourceType: 'module',
10+
},
11+
rules: {
12+
// Basic ESLint rules from original configuration
13+
'block-scoped-var': 'error',
14+
'comma-dangle': ['error', 'always-multiline'],
15+
curly: ['error', 'all'],
16+
'no-confusing-arrow': 'error',
17+
'no-inline-comments': 'warn',
18+
'no-invalid-this': 'error',
19+
'no-return-assign': 'warn',
20+
'no-constructor-return': 'error',
21+
'no-duplicate-imports': 'error',
22+
'no-self-compare': 'error',
23+
'no-console': ['error', { allow: ['warn', 'error'] }],
24+
'no-unmodified-loop-condition': 'error',
25+
'no-unused-private-class-members': 'error',
26+
'object-curly-spacing': ['error', 'always'],
27+
quotes: ['error', 'single', { avoidEscape: true }],
28+
semi: ['error', 'never'],
29+
},
30+
},
31+
// TypeScript files
32+
...tseslint.configs.recommended.map(config => ({
33+
...config,
34+
files: ['**/*.ts'],
35+
})),
36+
{
37+
files: ['**/*.ts'],
38+
rules: {
39+
// Override TypeScript rules to match original configuration
40+
'@typescript-eslint/no-unused-vars': [
41+
'error',
42+
{
43+
vars: 'all',
44+
args: 'after-used',
45+
ignoreRestSiblings: false,
46+
argsIgnorePattern: '^_',
47+
varsIgnorePattern: '^_',
48+
caughtErrorsIgnorePattern: '^_',
49+
},
50+
],
51+
'@typescript-eslint/no-explicit-any': ['error', { ignoreRestArgs: true }],
52+
// Basic ESLint rules
53+
'block-scoped-var': 'error',
54+
'comma-dangle': ['error', 'always-multiline'],
55+
curly: ['error', 'all'],
56+
'no-confusing-arrow': 'error',
57+
'no-inline-comments': 'warn',
58+
'no-invalid-this': 'error',
59+
'no-return-assign': 'warn',
60+
'no-constructor-return': 'error',
61+
'no-duplicate-imports': 'error',
62+
'no-self-compare': 'error',
63+
'no-console': ['error', { allow: ['warn', 'error'] }],
64+
'no-unmodified-loop-condition': 'error',
65+
'no-unused-private-class-members': 'error',
66+
'object-curly-spacing': ['error', 'always'],
67+
quotes: ['error', 'single', { avoidEscape: true }],
68+
semi: ['error', 'never'],
69+
},
70+
},
71+
{
72+
// Global ignores for all packages
73+
ignores: [
74+
'node_modules/**',
75+
'**/dist/**',
76+
'**/coverage/**',
77+
'**/uploads/**',
78+
'**/data/**',
79+
'**/test-setup.ts',
80+
'**/*.db',
81+
'**/migrations/**',
82+
'**/lib/**',
83+
'**/docker/**',
84+
'**/supervisor/**',
85+
'**/scripts/**',
86+
'**/jest.config.js',
87+
'bundle.sh',
88+
'docker-compose*.yml',
89+
'Dockerfile*',
90+
'.pnp.*',
91+
'.yarn/**',
92+
'logs/**',
93+
],
94+
},
95+
]

0 commit comments

Comments
 (0)