Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
172 lines (164 loc) · 4.99 KB
/
Copy patheslint.config.js
File metadata and controls
172 lines (164 loc) · 4.99 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
import js from '@eslint/js';
import prettierConfig from 'eslint-config-prettier';
import prettier from 'eslint-plugin-prettier';
export default [
js.configs.recommended,
prettierConfig,
{
plugins: {
prettier
},
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
// Browser globals
window: 'readonly',
document: 'readonly',
console: 'readonly',
performance: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
fetch: 'readonly',
Response: 'readonly',
Request: 'readonly',
Headers: 'readonly',
FormData: 'readonly',
// Node.js globals for scripts
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
AbortController: 'readonly',
// WebAssembly globals
WebAssembly: 'readonly',
// Test globals (for Vitest)
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
vi: 'readonly'
}
},
rules: {
// Prettier integration - let Prettier handle formatting
'prettier/prettier': 'warn',
// Possible problems
'no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
],
'no-undef': 'error',
'no-unreachable': 'warn',
'no-duplicate-imports': 'error',
// Suggestions
'prefer-const': 'warn',
'no-var': 'error',
'prefer-arrow-callback': 'warn',
'prefer-template': 'warn',
'prefer-destructuring': [
'warn',
{
array: false,
object: true
}
],
// Best practices
eqeqeq: ['error', 'always'],
'no-eval': 'error',
'no-implied-eval': 'error',
'no-new-func': 'error',
'no-throw-literal': 'error',
'no-return-assign': 'error',
'no-self-compare': 'error',
'no-unmodified-loop-condition': 'error',
'no-loop-func': 'error',
// ES6+ specific (non-formatting)
'no-confusing-arrow': 'warn',
'prefer-spread': 'warn'
}
},
{
files: ['tests/**/*.js', '**/*.test.js', '**/*test.js'],
rules: {
// Relax some rules for test files
'no-unused-expressions': 'off',
'max-len': 'off',
'no-unused-vars': 'off' // Test files often have unused imports for future use
}
},
{
files: ['scripts/interfaces/**/*.js'],
rules: {
// Interface definitions often have unused parameters
'no-unused-vars': 'off'
}
},
{
files: ['scripts/**/*.js'],
languageOptions: {
globals: {
// Additional Node.js globals for scripts
require: 'readonly',
module: 'readonly',
exports: 'readonly',
chalk: 'readonly'
}
}
},
{
files: ['scripts/services/BrowserService.js'],
languageOptions: {
globals: {
// Browser APIs used by BrowserService
caches: 'readonly',
localStorage: 'readonly',
sessionStorage: 'readonly',
chalk: 'readonly'
}
}
},
{
files: ['harness/web/**/*.js'],
languageOptions: {
globals: {
// Additional browser-specific globals for web harness
location: 'readonly',
navigator: 'readonly',
history: 'readonly',
localStorage: 'readonly',
sessionStorage: 'readonly'
}
}
},
{
// Ignore patterns
ignores: [
'node_modules/**',
'builds/**',
'configs/**',
'data/**',
'docs/**',
'results/**',
'reports/**',
'analysis/figures/**',
'tasks/**',
'*.wasm',
'*.tmp',
'dev-server.log',
'test-results.json'
]
}
];