-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.js
More file actions
105 lines (102 loc) · 2.76 KB
/
eslint.config.js
File metadata and controls
105 lines (102 loc) · 2.76 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
export default [
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/build/**',
'**/.pytest_cache/**',
'**/__pycache__/**',
'**/coverage/**',
],
},
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
// Browser globals
window: 'readonly',
document: 'readonly',
console: 'readonly',
localStorage: 'readonly',
sessionStorage: 'readonly',
fetch: 'readonly',
FormData: 'readonly',
URLSearchParams: 'readonly',
URL: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
alert: 'readonly',
confirm: 'readonly',
prompt: 'readonly',
CustomEvent: 'readonly',
Event: 'readonly',
MouseEvent: 'readonly',
KeyboardEvent: 'readonly',
TouchEvent: 'readonly',
ResizeObserver: 'readonly',
IntersectionObserver: 'readonly',
MutationObserver: 'readonly',
HTMLElement: 'readonly',
Element: 'readonly',
Node: 'readonly',
NodeList: 'readonly',
Blob: 'readonly',
File: 'readonly',
FileReader: 'readonly',
Image: 'readonly',
navigator: 'readonly',
performance: 'readonly',
requestAnimationFrame: 'readonly',
getComputedStyle: 'readonly',
// Plotly global (used in umap.js)
Plotly: 'readonly',
// Swiper global (used in swiper.js)
Swiper: 'readonly',
},
},
rules: {
// Possible errors
'no-console': 'off',
'no-debugger': 'warn',
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-undef': 'error',
// Best practices
'eqeqeq': ['error', 'always'],
'curly': ['error', 'all'],
'no-eval': 'error',
'no-implied-eval': 'error',
'no-with': 'error',
'no-new-func': 'error',
// ES6+
'prefer-const': 'warn',
'no-var': 'warn',
'prefer-arrow-callback': 'warn',
'arrow-spacing': 'error',
// Style (mostly handled by Prettier, but some logical style rules)
// Note: quotes handled by Prettier, semi retained for logical consistency
'semi': ['error', 'always'],
},
},
{
files: ['tests/**/*.js', '**/*.test.js'],
languageOptions: {
globals: {
// Jest globals
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
jest: 'readonly',
global: 'readonly',
},
},
},
];