-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
42 lines (41 loc) · 1.27 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
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
/** @type {import('eslint').Linter.Config[]} */
export default tseslint.config(
{ files: ["**/*.{js,mjs,cjs,ts}"] },
pluginJs.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
...tseslint.configs.strictTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
"no-useless-assignment": "error",
"no-self-compare": "error",
"prefer-arrow-callback": "error",
"no-var": "error",
"no-shadow": "error",
"no-multi-assign": "error",
"no-labels": "error",
"no-implicit-coercion": "error",
eqeqeq: "error",
"no-array-constructor": "error",
curly: ["error", "multi-line"],
"func-style": "error",
"@typescript-eslint/strict-boolean-expressions": [
"error",
{ allowString: false, allowNullableBoolean: true, allowNumber: false },
],
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/consistent-type-assertions": "error",
},
},
);