-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
78 lines (77 loc) · 2.21 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import eslint from "@eslint/js";
import importPlugin from "eslint-plugin-import";
import tsEslint from "typescript-eslint";
export default tsEslint.config(
eslint.configs.recommended,
...tsEslint.configs.strict,
...tsEslint.configs.stylistic,
{
files: ["src/*.{mts,ts}", "src/**/*.{mts,ts}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parserOptions: {
projectService: true,
project: "./tsconfig.json",
},
},
plugins: {
import: importPlugin,
},
rules: {
/**
*
* Disable rules
*
*/
"@typescript-eslint/consistent-indexed-object-style": "off",
"@typescript-eslint/consistent-type-definitions": "off",
/**
*
* Enable rules
*
*/
"@typescript-eslint/explicit-module-boundary-types": "error",
// NOTE: If `@typescript-eslint/require-await` is enabled, `require-await` must be disabled
// https://typescript-eslint.io/rules/require-await/#how-to-use
"require-await": "off",
"@typescript-eslint/require-await": "error",
// NOTE: If `@typescript-eslint/no-empty-function` is enabled, `no-empty-function` must be disabled
// https://typescript-eslint.io/rules/no-empty-function/#how-to-use
"no-empty-function": "off",
"@typescript-eslint/no-empty-function": "warn",
"import/order": [
"warn",
{
alphabetize: { order: "asc" },
"newlines-between": "always",
},
],
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
},
// NOTE: Files specified in `ignores` are globally ignored by ESLint.
// Reference: https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
{
ignores: [
"dist",
"node_modules",
".vscode",
"package.json",
"vitest.config.mjs",
"docs",
"examples",
],
}
);