-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
61 lines (52 loc) · 1.84 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
import js from "@eslint/js";
import globals from "globals";
import ts from "typescript-eslint";
const typescriptRules = [ts.configs.eslintRecommended, ...ts.configs.recommended]
.map(config => config.rules)
.reduce((acc, rules) => ({ ...acc, ...rules }), {});
/** @type {import("eslint").Linter.Config[]} */
export default [
{
files: ["__tests__/**/*.ts", "src/**/*.ts"],
plugins: {
"@typescript-eslint": ts.plugin,
},
languageOptions: {
sourceType: "module",
parser: ts.parser,
globals: {
...globals.browser,
...globals.node,
},
parserOptions: {
tsconfigRootDir: import.meta.dirname,
projectService: false,
},
},
rules: {
...js.configs.recommended.rules,
...typescriptRules,
"no-implicit-coercion": "error",
"no-param-reassign": "error",
"object-shorthand": "error",
"@typescript-eslint/ban-ts-comment": [
"error",
{ "ts-check": true, "ts-expect-error": false },
],
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unsafe-declaration-merging": "error",
"@typescript-eslint/no-unsafe-function-type": "error",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-wrapper-object-types": "error",
"@typescript-eslint/prefer-as-const": "error",
},
}
];