-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
76 lines (75 loc) · 2.18 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
import jsEslint from "@eslint/js";
import gitignore from "eslint-config-flat-gitignore";
import eslintConfigPrettier from "eslint-config-prettier";
import importX from "eslint-plugin-import-x";
import perfectionist from "eslint-plugin-perfectionist";
import tsEslint from "typescript-eslint";
export default tsEslint.config(
jsEslint.configs.recommended,
...tsEslint.configs.recommended,
eslintConfigPrettier,
importX.flatConfigs.recommended,
perfectionist.configs["recommended-natural"],
gitignore(),
{
languageOptions: {
ecmaVersion: "latest",
globals: {
console: true,
process: true,
},
sourceType: "module",
},
rules: {
"prefer-const": "off",
"sort-imports": "off",
},
},
{
rules: {
"import-x/consistent-type-specifier-style": ["error", "prefer-inline"],
"import-x/no-duplicates": ["error", { considerQueryString: true, "prefer-inline": true }],
"import-x/no-unresolved": "off",
"import-x/order": "off",
"perfectionist/sort-imports": [
"error",
{
groups: [
"side-effect-style",
"style",
["builtin-type", "external-type", "internal-type", "parent-type", "sibling-type", "index-type"],
["builtin", "external"],
["internal", "parent", "sibling", "index"],
"object",
"unknown",
],
},
],
},
},
{
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
languageOptions: {
parser: tsEslint.parser,
},
plugins: {
"@typescript-eslint": tsEslint.plugin,
},
rules: {
"@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
varsIgnorePattern: "^_",
},
],
},
},
);