-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
51 lines (51 loc) · 1.4 KB
/
Copy patheslint.config.js
File metadata and controls
51 lines (51 loc) · 1.4 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
export default [
{
languageOptions: {
ecmaVersion: 2024,
sourceType: 'module',
globals: {
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
fetch: 'readonly',
URL: 'readonly',
module: 'readonly',
require: 'readonly',
AbortController: 'readonly',
AbortSignal: 'readonly',
},
},
rules: {
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'no-undef': 'error',
'prefer-const': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-arrow-callback': 'error',
'arrow-spacing': 'error',
'space-before-blocks': 'error',
'keyword-spacing': 'error',
'comma-spacing': 'error',
semi: ['error', 'always'],
quotes: ['error', 'single'],
indent: ['error', 2],
'no-trailing-spaces': 'error',
'eol-last': 'error',
},
},
{
files: ['tests/**/*.js'],
rules: {
// vi.fn(function() {}) must stay as function() — arrow functions
// can't be constructors, and mocks using `new MockClass()` break
'prefer-arrow-callback': 'off',
},
},
];