-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
44 lines (43 loc) · 1.21 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import eslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
export default [
// Base configuration for all JavaScript files
{
ignores: ['dist/**', 'node_modules/**'],
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'no-unused-vars': 'warn',
'no-console': ['warn', { allow: ['error', 'warn', 'info'] }],
},
},
// TypeScript specific configuration
{
ignores: ['dist/**', 'node_modules/**'],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: process.cwd(),
},
},
plugins: {
'@typescript-eslint': eslint,
},
rules: {
// First apply recommended rules
...eslint.configs.recommended.rules,
// Then override specific rules
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'no-console': ['warn', { allow: ['error', 'warn', 'info'] }],
'@typescript-eslint/no-explicit-any': 'off', // Disable the no-explicit-any rule
},
},
];