Skip to content

Commit df714fc

Browse files
committed
add eslint.config.mjs
1 parent cddad95 commit df714fc

File tree

1 file changed

+210
-0
lines changed

1 file changed

+210
-0
lines changed

eslint.config.mjs

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
import globals from "globals";
2+
import path from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
import js from "@eslint/js";
5+
import { FlatCompat } from "@eslint/eslintrc";
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all
13+
});
14+
15+
export default [...compat.extends("eslint:recommended"), {
16+
languageOptions: {
17+
globals: {
18+
...globals.node,
19+
...globals.mocha,
20+
},
21+
22+
ecmaVersion: 5,
23+
sourceType: "module",
24+
},
25+
26+
rules: {
27+
"accessor-pairs": "error",
28+
"array-bracket-spacing": ["error", "never"],
29+
"array-callback-return": "off",
30+
"arrow-body-style": ["error", "as-needed"],
31+
"arrow-parens": ["error", "always"],
32+
33+
"arrow-spacing": ["error", {
34+
after: true,
35+
before: true,
36+
}],
37+
38+
"block-scoped-var": "error",
39+
"block-spacing": "error",
40+
"brace-style": ["error", "1tbs"],
41+
"callback-return": "error",
42+
camelcase: "error",
43+
44+
"comma-spacing": ["error", {
45+
after: true,
46+
before: false,
47+
}],
48+
49+
"comma-style": ["error", "last"],
50+
complexity: "error",
51+
"computed-property-spacing": ["error", "never"],
52+
"consistent-return": "error",
53+
"consistent-this": "error",
54+
curly: "error",
55+
"default-case": "error",
56+
"dot-location": "error",
57+
"dot-notation": "error",
58+
"eol-last": "error",
59+
eqeqeq: "error",
60+
"func-names": "off",
61+
"func-style": ["error", "declaration"],
62+
"generator-star-spacing": "error",
63+
"global-require": "error",
64+
"guard-for-in": "error",
65+
"handle-callback-err": "error",
66+
"id-blacklist": "error",
67+
"id-length": "off",
68+
"id-match": "error",
69+
indent: "off",
70+
"init-declarations": "error",
71+
"jsx-quotes": "error",
72+
"key-spacing": "error",
73+
74+
"keyword-spacing": ["error", {
75+
after: true,
76+
before: true,
77+
}],
78+
79+
"linebreak-style": ["error", "unix"],
80+
"lines-around-comment": "error",
81+
"max-depth": "error",
82+
"max-len": "off",
83+
"max-nested-callbacks": "error",
84+
"max-params": "error",
85+
"max-statements": "off",
86+
"max-statements-per-line": "error",
87+
"new-cap": "error",
88+
"new-parens": "error",
89+
"newline-after-var": "off",
90+
"newline-before-return": "off",
91+
"newline-per-chained-call": "off",
92+
"no-alert": "error",
93+
"no-array-constructor": "off",
94+
"no-bitwise": "error",
95+
"no-caller": "error",
96+
"no-catch-shadow": "error",
97+
"no-confusing-arrow": "error",
98+
"no-console": "off",
99+
"no-continue": "error",
100+
"no-div-regex": "error",
101+
"no-duplicate-imports": "error",
102+
"no-else-return": "error",
103+
"no-empty-function": "error",
104+
"no-eq-null": "error",
105+
"no-eval": "error",
106+
"no-extend-native": "error",
107+
"no-extra-bind": "error",
108+
"no-extra-label": "error",
109+
"no-extra-parens": "error",
110+
"no-floating-decimal": "error",
111+
"no-implicit-coercion": "error",
112+
"no-implicit-globals": "error",
113+
"no-implied-eval": "error",
114+
"no-inline-comments": "error",
115+
"no-invalid-this": "off",
116+
"no-iterator": "error",
117+
"no-label-var": "error",
118+
"no-labels": "error",
119+
"no-lone-blocks": "error",
120+
"no-lonely-if": "error",
121+
"no-loop-func": "error",
122+
"no-magic-numbers": "off",
123+
"no-mixed-requires": "error",
124+
"no-multi-spaces": "off",
125+
"no-multi-str": "error",
126+
"no-multiple-empty-lines": "error",
127+
"no-native-reassign": "error",
128+
"no-negated-condition": "error",
129+
"no-nested-ternary": "error",
130+
"no-new": "error",
131+
"no-new-func": "error",
132+
"no-new-object": "error",
133+
"no-new-require": "error",
134+
"no-new-wrappers": "error",
135+
"no-octal-escape": "error",
136+
"no-param-reassign": "error",
137+
"no-path-concat": "error",
138+
"no-plusplus": "error",
139+
"no-process-env": "error",
140+
"no-process-exit": "error",
141+
"no-proto": "error",
142+
"no-restricted-globals": "error",
143+
"no-restricted-imports": "error",
144+
"no-restricted-modules": "error",
145+
"no-restricted-syntax": "error",
146+
"no-return-assign": "error",
147+
"no-script-url": "error",
148+
"no-self-compare": "error",
149+
"no-sequences": "error",
150+
"no-shadow": "error",
151+
"no-shadow-restricted-names": "error",
152+
"no-spaced-func": "error",
153+
"no-sync": "off",
154+
"no-ternary": "error",
155+
"no-throw-literal": "error",
156+
"no-trailing-spaces": "error",
157+
"no-undef-init": "error",
158+
"no-undefined": "error",
159+
"no-underscore-dangle": "error",
160+
"no-unmodified-loop-condition": "error",
161+
"no-unneeded-ternary": "error",
162+
"no-unused-expressions": "error",
163+
"no-use-before-define": "error",
164+
"no-useless-call": "error",
165+
"no-useless-concat": "error",
166+
"no-useless-constructor": "error",
167+
"no-useless-escape": "error",
168+
"no-var": "error",
169+
"no-void": "error",
170+
"no-warning-comments": "error",
171+
"no-whitespace-before-property": "error",
172+
"no-with": "error",
173+
"object-curly-spacing": ["error", "never"],
174+
"object-shorthand": "error",
175+
"one-var": "off",
176+
"one-var-declaration-per-line": "off",
177+
"operator-assignment": "error",
178+
"operator-linebreak": "error",
179+
"padded-blocks": "off",
180+
"prefer-arrow-callback": "off",
181+
"prefer-const": "off",
182+
"prefer-reflect": "off",
183+
"prefer-rest-params": "error",
184+
"prefer-spread": "error",
185+
"prefer-template": "error",
186+
"quote-props": "off",
187+
quotes: ["error", "double"],
188+
radix: "error",
189+
"require-jsdoc": "off",
190+
"require-yield": "error",
191+
semi: "error",
192+
"semi-spacing": "error",
193+
"sort-imports": "off",
194+
"sort-vars": "off",
195+
"space-before-blocks": "error",
196+
"space-before-function-paren": "off",
197+
"space-in-parens": "off",
198+
"space-infix-ops": "error",
199+
"space-unary-ops": "error",
200+
"spaced-comment": ["error", "always"],
201+
strict: "error",
202+
"template-curly-spacing": ["error", "never"],
203+
"valid-jsdoc": "error",
204+
"vars-on-top": "error",
205+
"wrap-iife": "error",
206+
"wrap-regex": "error",
207+
"yield-star-spacing": "error",
208+
yoda: ["error", "never"],
209+
},
210+
}];

0 commit comments

Comments
 (0)