-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy patheslint.config.js
More file actions
69 lines (66 loc) · 2.33 KB
/
eslint.config.js
File metadata and controls
69 lines (66 loc) · 2.33 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
const js = require('@eslint/js');
module.exports = [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2023,
sourceType: 'commonjs',
globals: {
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
module: 'readonly',
require: 'readonly',
exports: 'readonly',
// Node.js built-in globals
fetch: 'readonly',
AbortController: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
URLSearchParams: 'readonly',
// Mocha globals
describe: 'readonly',
it: 'readonly',
before: 'readonly',
after: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly'
}
},
rules: {
// Crockford-inspired formatting
'indent': ['error', 4],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'no-trailing-spaces': 'error',
'eol-last': 'error',
'no-multiple-empty-lines': ['error', { 'max': 1 }],
'comma-dangle': ['error', 'never'],
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
'space-before-function-paren': ['error', 'never'],
'keyword-spacing': 'error',
'space-infix-ops': 'error',
'space-unary-ops': 'error',
// Code quality
'no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }],
'no-console': 'off',
'no-debugger': 'error',
'no-eval': 'error',
'no-implied-eval': 'error',
'no-with': 'error',
'no-caller': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-multi-spaces': 'error',
'no-global-assign': 'error',
// Your custom overrides
'no-underscore-dangle': 'off',
'no-continue': 'off'
}
}
];