-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.js
153 lines (152 loc) · 6.49 KB
/
eslint.config.js
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import globals from "globals"
import js from "@eslint/js"
import n from "eslint-plugin-n"
import stylistic from "@stylistic/eslint-plugin"
export default [
// I have no clue why on earth it's not spelled out in the docs that `ignores` needs to be in
// the first entry of the config, before anything else.
// https://github.com/eslint/eslint/discussions/18304#discussioncomment-9069706
{
ignores: ["dist"],
},
js.configs.recommended,
n.configs["flat/recommended"],
{
name: "root config",
plugins: {
"@stylistic": stylistic,
},
languageOptions: {
ecmaVersion: 2022,
globals: {
...globals.nodeBuiltin,
...globals.es2022,
},
},
rules: {
"accessor-pairs": "error",
"@stylistic/array-bracket-spacing": [
"error",
"never"
],
"array-callback-return": "error",
"arrow-body-style": "error",
"@stylistic/arrow-parens": "error",
"@stylistic/arrow-spacing": "error",
"@stylistic/block-spacing": ["error", "always"],
"@stylistic/brace-style": ["error", "1tbs"],
"@stylistic/comma-dangle": ["error", "only-multiline"],
"@stylistic/comma-spacing": ["error", {before: false, after: true}],
"@stylistic/comma-style": ["error", "last"],
"@stylistic/computed-property-spacing": ["error", "never"],
"curly": ["error", "multi-line", "consistent"],
"@stylistic/dot-location": ["error", "property"],
"dot-notation": "error",
"@stylistic/eol-last": "error",
"eqeqeq": ["error", "always", {null: "ignore"}],
"@stylistic/function-call-spacing": "error",
"@stylistic/generator-star-spacing": "error",
"n/handle-callback-err": "error",
"id-match": ["error", "^_?(?:[A-Za-z$][\\w$]*|[$A-Z][$A-Z0-9]*(?:_[$A-Z0-9]+)*)$", {properties: false}],
"@stylistic/indent": ["error", 4, {outerIIFEBody: 0, SwitchCase: 1}],
"@stylistic/implicit-arrow-linebreak": ["error", "beside"],
"@stylistic/key-spacing": "error",
"@stylistic/keyword-spacing": "error",
"@stylistic/linebreak-style": ["error", "unix"],
"@stylistic/lines-around-comment": ["error", {
beforeBlockComment: true,
allowBlockStart: true,
allowBlockEnd: true,
allowObjectStart: true,
allowObjectEnd: true,
allowArrayStart: true,
allowArrayEnd: true,
allowClassStart: true,
allowClassEnd: true,
}],
"@stylistic/multiline-comment-style": "off",
"@stylistic/new-parens": "error",
"@stylistic/newline-per-chained-call": "error",
"no-alert": "error",
"no-array-constructor": "error",
"no-bitwise": "error",
"no-caller": "error",
"@stylistic/no-confusing-arrow": "error",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-eval": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"@stylistic/no-extra-semi": "error",
"@stylistic/no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-iterator": "error",
"no-lone-blocks": "error",
"n/no-mixed-requires": "error",
"@stylistic/no-multi-spaces": "error",
"no-multi-str": "error",
"@stylistic/no-multiple-empty-lines": "error",
"no-native-reassign": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"n/no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"n/no-process-exit": "error",
"no-proto": "error",
"no-redeclare": "error",
"no-restricted-syntax": [
"error",
{selector: "ForInStatement", message: "Use `for (const key of Object.keys(object))` instead."}
],
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "error",
"@stylistic/no-tabs": "error",
"no-throw-literal": "error",
"@stylistic/no-trailing-spaces": ["error", {skipBlankLines: true}],
"no-undef-init": "error",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "error",
"no-unreachable-loop": "error",
"no-unused-vars": ["error", {
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
reportUsedIgnorePattern: true,
}],
"no-useless-assignment": "error",
"no-useless-call": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-var": "error",
"@stylistic/no-whitespace-before-property": "error",
"object-curly-spacing": ["error", "never"],
"object-shorthand": "off",
"one-var": ["error", {initialized: "never"}],
"one-var-declaration-per-line": "off",
"operator-assignment": ["error", "always"],
"@stylistic/operator-linebreak": "off",
"@stylistic/padded-blocks": ["error", "never"],
"prefer-const": "error",
"n/prefer-node-protocol": "error",
"@stylistic/quotes": ["error", "double", {avoidEscape: true}],
"radix": ["error", "always"],
"require-yield": "error",
"@stylistic/semi": ["error", "never"],
"sort-imports": ["error", {allowSeparatedGroups: true}],
"@stylistic/space-before-blocks": ["error", "always"],
"@stylistic/space-before-function-paren": ["error", "never"],
"@stylistic/space-in-parens": ["error", "never"],
"@stylistic/space-unary-ops": "error",
"strict": ["error", "global"],
"@stylistic/template-curly-spacing": "error",
"@stylistic/wrap-regex": "error",
"@stylistic/yield-star-spacing": "error",
}
}
]