-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy patheslint.config.mjs
89 lines (87 loc) · 2.05 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
79
80
81
82
83
84
85
86
87
88
89
import eslint from "@eslint/js";
import tsparser from "@typescript-eslint/parser";
import esimport from "eslint-plugin-import";
import prettier from "eslint-plugin-prettier";
import unusedImports from "eslint-plugin-unused-imports";
import vitest from "eslint-plugin-vitest";
import globals from "globals";
import tseslint from "typescript-eslint";
const config = tseslint.config(
{
ignores: [
"**/.env",
"**/.DS_Store",
"**/.gitignore",
"**/.prettierignore",
"**/.vscode/*",
"**/node_modules/*",
"**/dist/*",
"**/docs/*",
"**/doc/*",
"**/bundle/*",
"**/coverage/*",
"**/flamegraph.*",
"**/tsconfig.tsbuildinfo",
"**/benchmark-output.txt",
"**/*.log",
"**/*_pb.js",
"**/*_pb.ts",
],
},
eslint.configs.recommended,
tseslint.configs.strict,
{
plugins: {
"@typescript-eslint": tseslint.plugin,
"import": esimport,
"prettier": prettier,
"unused-imports": unusedImports,
"vitest": vitest,
},
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
tsconfigRootDir: import.meta.dirname,
project: "./tsconfig.json",
},
globals: {
...globals.node,
...globals.es2021,
},
},
rules: {
"prettier/prettier": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "_",
argsIgnorePattern: "_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "_",
},
],
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-floating-promises": "error",
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"prefer-const": "error",
"import/order": [
"error",
{
"groups": [["builtin", "external", "internal"]],
"newlines-between": "always",
"alphabetize": {
order: "asc",
caseInsensitive: true,
},
},
],
},
}
);
export default config;