-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
eslint.config.mjs
81 lines (79 loc) · 1.92 KB
/
eslint.config.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// eslint.config.mjs
import js from '@eslint/js';
// Define globals for the environments you want to support
const envGlobals = {
node: {
require: "readonly",
module: "readonly",
process: "readonly",
__dirname: "readonly",
__filename: "readonly",
exports: "readonly",
console: "readonly",
global: "readonly",
setTimeout: "readonly",
setInterval: "readonly",
clearTimeout: "readonly",
clearInterval: "readonly",
Buffer: "readonly",
},
browser: {
window: "readonly",
document: "readonly",
navigator: "readonly",
console: "readonly",
alert: "readonly",
fetch: "readonly",
location: "readonly",
history: "readonly",
localStorage: "readonly",
sessionStorage: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
setInterval: "readonly",
clearInterval: "readonly",
},
es6: {
Promise: "readonly",
Symbol: "readonly",
Map: "readonly",
Set: "readonly",
WeakMap: "readonly",
WeakSet: "readonly",
Proxy: "readonly",
Reflect: "readonly",
globalThis: "readonly",
},
mocha: {
describe: "readonly",
it: "readonly",
before: "readonly",
after: "readonly",
beforeEach: "readonly",
afterEach: "readonly",
context: "readonly",
}
};
export default [
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...envGlobals.node,
...envGlobals.browser,
...envGlobals.es6,
...envGlobals.mocha,
},
},
rules: {
'no-irregular-whitespace': ['error', {
skipStrings: true, // Skip irregular whitespace in strings
skipComments: true, // Skip irregular whitespace in comments
skipRegExps: true, // (Optional) Include or skip RegExps
skipTemplates: true, // (Optional) Include or skip template literals
}],
},
},
js.configs.recommended,
];