-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
93 lines (90 loc) · 2.32 KB
/
eslint.config.mjs
File metadata and controls
93 lines (90 loc) · 2.32 KB
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
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import prettierConfig from "eslint-config-prettier";
import simpleImportSort from "eslint-plugin-simple-import-sort";
const rootDir = import.meta.dirname;
export default tseslint.config(
{
ignores: [
"**/.vite/",
"**/.yarn/",
"**/.pnp.*",
"**/dist/",
"tools/",
"eslint.config.mjs",
],
},
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
prettierConfig,
{
plugins: {
"simple-import-sort": simpleImportSort,
},
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
"no-console": "warn",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
},
},
{
files: ["**/*.ts", "**/*.mts", "**/*.cts"],
rules: {
"@typescript-eslint/no-confusing-void-expression": [
"error",
{
ignoreArrowShorthand: true,
ignoreVoidOperator: true,
},
],
"@typescript-eslint/no-floating-promises": [
"error",
{ ignoreVoid: true },
],
// not compatible with specifying void return types via generics
// see also https://github.com/typescript-eslint/typescript-eslint/issues/8113
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
vars: "all",
varsIgnorePattern: "^_",
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
// reportUsedIgnorePattern: true,
},
],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNumber: true,
allowBoolean: true,
allowNullish: true,
},
],
},
},
{
files: ["src/cli/**/*.ts", "src/cli/**/*.mts", "src/cli/**/*.cts"],
rules: {
"no-console": "off",
},
},
{
languageOptions: {
parserOptions: {
tsconfigRootDir: rootDir,
// typescript-eslint specific options
warnOnUnsupportedTypeScriptVersion: true,
projectService: true,
},
},
},
);