-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
83 lines (81 loc) · 2.23 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
82
83
import eslintPluginJs from "@eslint/js"
import eslintPluginStylistic from "@stylistic/eslint-plugin"
import globals from "globals"
const config = [
{
files: ["**/*.js"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
Log: "readonly",
Module: "readonly",
},
sourceType: "commonjs"
},
plugins: {
...eslintPluginStylistic.configs["recommended-flat"].plugins,
},
rules: {
...eslintPluginJs.configs.all.rules,
...eslintPluginStylistic.configs["recommended-flat"].rules,
"@stylistic/brace-style": ["error", "1tbs", {allowSingleLine: true}],
"@stylistic/comma-dangle": ["error", "only-multiline"],
"@stylistic/indent": ["error", "tab"],
"@stylistic/max-statements-per-line": ["error", {max: 2}],
"@stylistic/no-tabs": "off",
"@stylistic/quotes": ["error", "double"],
"capitalized-comments": "off",
complexity: "off",
"consistent-this": "off",
eqeqeq: "warn",
"init-declarations": "off",
"max-depth": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"max-params": "off",
"max-statements": ["error", {max: 80}],
"no-else-return": "off",
"no-eq-null": "warn",
"no-await-in-loop": "warn",
"no-compare-neg-zero": "warn",
"no-inline-comments": "off",
"no-magic-numbers": "off",
"no-negated-condition": "off",
"no-param-reassign": "off",
"no-plusplus": "off",
"no-useless-assignment": "warn",
"one-var": "off",
"prefer-destructuring": "off",
"sort-keys": "off",
strict: "off",
}
},
{
files: ["**/*.mjs"],
languageOptions: {
globals: {
...globals.node
},
sourceType: "module"
},
plugins: {
...eslintPluginStylistic.configs["all-flat"].plugins
},
rules: {
...eslintPluginStylistic.configs["all-flat"].rules,
"@stylistic/array-element-newline": "off",
"@stylistic/comma-dangle": ["error", "only-multiline"],
"@stylistic/indent": ["error", "tab"],
"@stylistic/object-property-newline": "off",
"@stylistic/padded-blocks": ["error", "never"],
"@stylistic/quote-props": ["error", "as-needed"],
"@stylistic/semi": ["error", "never"],
"func-style": "off",
"max-lines-per-function": ["error", 100],
"no-magic-numbers": "off",
"one-var": "off"
}
}
]
export default config