-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.cjs
72 lines (69 loc) · 1.86 KB
/
eslint.config.cjs
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
const js = require("@eslint/js"),
stylistic = require("@stylistic/eslint-plugin-js");
module.exports = [
{
"files": ["**/*.js"],
"ignores": [
"app/assets/builds/**",
"app/assets/config/manifest.js",
"node_modules/**",
"vendor/**"
],
"languageOptions": {
"globals": {
"document": "readonly",
"module": "readonly",
"require": "readonly",
"window": "readonly"
},
"parserOptions": {
"sourceType": "module"
}
},
"plugins": {
"@stylistic/js": stylistic
},
"rules": {
...js.configs.recommended.rules,
...stylistic.configs["all-flat"].rules,
"arrow-body-style": ["error", "always"],
"no-magic-numbers": ["error", { "ignore": [0, 1] }],
"@stylistic/js/array-element-newline": ["error", "consistent"],
"@stylistic/js/function-call-argument-newline": ["error", "consistent"],
"@stylistic/js/function-paren-newline": ["error", "consistent"],
"@stylistic/js/indent": [
"error",
2, /* eslint no-magic-numbers: 0 */
{
"VariableDeclarator": {
"const": 3,
"let": 2,
"var": 2
}
}
],
"@stylistic/js/lines-around-comment": ["error", { "allowClassStart": true }],
"@stylistic/js/object-curly-spacing": ["error", "always"],
"@stylistic/js/padded-blocks": "off",
"@stylistic/js/space-before-function-paren": "off"
}
},
{
"files": ["spec/**/*.js"],
"languageOptions": {
"globals": {
"afterEach": "readonly",
"beforeEach": "readonly",
"context": "readonly",
"describe": "readonly",
"expect": "readonly",
"global": "readonly",
"it": "readonly",
"sinon": "readonly"
}
},
"rules": {
"no-magic-numbers": "off"
}
}
];