-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.base.mjs
62 lines (58 loc) · 1.48 KB
/
eslint.base.mjs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import eslint from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import typescript from '@typescript-eslint/parser';
import prettier from 'eslint-config-prettier';
export default [
// Base ESLint configuration
eslint.configs.recommended,
// TypeScript configurations
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: typescript,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': tseslint,
},
rules: {
// Disable the base ESLint rule
'no-unused-vars': 'off',
'no-dupe-class-members': 'off',
'no-redeclare': 'off',
// Enable the TypeScript rule
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
destructuredArrayIgnorePattern: '^_'
}],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-console': 'warn',
},
},
// Prettier configuration
prettier,
// Global settings
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
node: true,
console: true,
window: true,
document: true,
globalThis: true,
EventTarget: true,
CustomEvent: true,
EventListener: true
},
},
ignores: ['dist/', 'node_modules/'],
},
];