-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
149 lines (147 loc) · 4.02 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import solid from "eslint-plugin-solid";
import perfectionist from "eslint-plugin-perfectionist";
export default tseslint.config(
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
rules: eslint.configs.recommended.rules
},
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
ignores: [
"**/dist/*",
"**/node_modules/*",
"**/deprecated/*",
"**/bundle-dts.js"
]
},
{
languageOptions: {
globals: {
"__dirname": true,
"DateLike": true,
"Nullable": true,
"Nullish": true,
"VoidFn": true,
"Undefinable": true
},
parserOptions: {
ecmaFeatures: {
jsx: true
},
project: [
"./tsconfig.base.json",
"./tsconfig.node.json",
"./src/**/tsconfig.json",
"./src/**/tsconfig.test.json",
],
tsconfigRootDir: import.meta.dirname,
ecmaVersion: "latest"
}
}
},
{
files: [ "**/*.{ts,tsx}" ],
plugins: {
"solid": solid.configs["flat/typescript"].plugins.solid
},
rules: solid.configs["flat/typescript"].rules,
languageOptions: {
parser: tseslint.parser
}
},
{
files: [ "**/*.{ts,tsx}" ],
plugins: {
"@typescript-eslint": tseslint.plugin,
perfectionist: perfectionist
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: [
"./tsconfig.base.json",
"./tsconfig.node.json",
"./src/**/tsconfig.json",
"./src/**/tsconfig.test.json"
],
/* EXPERIMENTAL_useProjectService: {
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 12,
} */
},
},
rules: {
"perfectionist/sort-array-includes": "error",
"perfectionist/sort-classes": "error",
"perfectionist/sort-enums": "error",
"perfectionist/sort-exports": "error",
"perfectionist/sort-imports": [
"error", {
ignoreCase: true,
type: "alphabetical",
order: "asc",
groups: [
[ "builtin", "external" ],
[ "builtin-type", "external-type" ],
[ "internal" ],
[ "parent", "sibling" ],
[ "side-effect" ],
[ "internal-type", "parent-type", "sibling-type", "index-type" ],
[ "side-effect-style" ],
[ "style" ],
"unknown"
],
newlinesBetween: "always",
internalPattern: [
"@lib/**"
]
}
],
"perfectionist/sort-interfaces": "error",
"perfectionist/sort-jsx-props": [ "error", {
ignorePattern: [ "Meta", "Show" ],
}],
"perfectionist/sort-maps": "error",
"perfectionist/sort-named-imports": "error",
"perfectionist/sort-named-exports": "error",
"perfectionist/sort-object-types": "error",
"perfectionist/sort-objects": "error",
"perfectionist/sort-intersection-types": "error",
"perfectionist/sort-union-types": "error",
"no-self-assign": "off",
"no-console": [ "error", { "allow": [ "warn", "error" ] }],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unused-vars": [
"error", { "argsIgnorePattern": "_" }
],
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-confusing-void-expression": [ "error", {
ignoreArrowShorthand: true
}],
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/prefer-for-of": "off",
"comma-dangle": ["error", {
"arrays": "never",
"objects": "never",
"imports": "never",
"exports": "never"
}],
"indent": [ "error", "tab", { "SwitchCase": 1 } ],
"linebreak-style": 0,
"quotes": [ "error", "double" ],
"semi": [ "error", "always" ],
"no-var": "error",
"curly": "error"
}
}
);