-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy patheslint.config.mjs
55 lines (53 loc) · 1.7 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
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginSimpleImportSort from "eslint-plugin-simple-import-sort";
export default [
{
ignores: ["**/dist/**", "**/examples/**", "**/node_modules/**"],
},
...[
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
].map((conf) => ({
...conf,
files: ["**/*.ts"],
})),
{
files: ["**/*.ts"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
"@typescript-eslint": tseslint.plugin,
"simple-import-sort": pluginSimpleImportSort,
},
rules: {
// typescript-eslint
"@typescript-eslint/consistent-return": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-redundant-type-constituents": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
// simple-import-sort
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",
},
},
{
// disable type-aware linting on JS files
files: ["**/*.js"],
...tseslint.configs.disableTypeChecked,
},
];