-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy patheslint.config.js
110 lines (106 loc) · 2.42 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
import eslint from "@eslint/js";
import prettierConfig from "eslint-config-prettier";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
eslint.configs.recommended,
prettierConfig,
{
ignores: [
"_site/",
".yarn/",
".git/",
"docs/",
"lib/",
"node_modules/",
"packages/documentation/.venv/",
"packages/documentation/public/",
"packages/*/build/",
"packages/*/coverage/",
"packages/*/output/",
"packages/*/vite.config.*",
"*.config.*",
],
},
{
languageOptions: {
globals: {
...globals.node,
...globals.web,
},
},
linterOptions: {
reportUnusedDisableDirectives: "error",
},
},
{
files: ["**/*.cjs"],
languageOptions: {
parserOptions: {
sourceType: "commonjs",
},
},
},
{
files: ["**/*.js", "**/*.mjs"],
languageOptions: {
parserOptions: {
sourceType: "module",
},
},
},
{
files: ["**/*.cts", "**/*.mts", "**/*.ts"],
extends: tseslint.configs.strictTypeChecked,
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
EXPERIMENTAL_useProjectService: true,
warnOnUnsupportedTypeScriptVersion: false,
},
},
rules: {
"@typescript-eslint/array-type": ["error", { default: "generic" }],
"@typescript-eslint/no-explicit-any": [
"error",
{
ignoreRestArgs: true,
},
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowBoolean: true,
allowNumber: true,
},
],
},
},
{
rules: {
"consistent-return": "error",
eqeqeq: "error",
"no-console": "off",
"no-else-return": "error",
"no-unused-expressions": "warn",
"no-use-before-define": "off",
"prefer-const": "error",
strict: ["error", "global"],
},
},
);