Skip to content

Commit 2382357

Browse files
fix: update import rules
1 parent 19ed80d commit 2382357

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

src/configs/typescript.ts

+16-5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ const baseConfig: Linter.Config = {
2626
"space-infix-ops": "off",
2727
},
2828

29+
settings: {
30+
"import/extensions": [
31+
".js",
32+
".ts",
33+
".jsx",
34+
".tsx",
35+
".mjs",
36+
".mts",
37+
".cjs",
38+
".cts",
39+
],
40+
"import/parsers": {
41+
"@typescript-eslint/parser": [".ts", ".tsx", ".mts", ".cts"],
42+
},
43+
},
44+
2945
overrides: [
3046
{
3147
files: ["**/*.ts", "**/*.tsx"],
@@ -37,11 +53,6 @@ const baseConfig: Linter.Config = {
3753

3854
"node/no-unsupported-features/es-syntax": "off",
3955
},
40-
settings: {
41-
"import/parsers": {
42-
"@typescript-eslint/parser": [".ts", ".tsx"],
43-
},
44-
},
4556
},
4657
],
4758
};

src/plugins/import.ts

+4-10
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,16 @@ export const settings: Linter.Config = {
138138
"index",
139139
],
140140
"newlines-between": "always",
141-
"pathGroups": [
142-
{
143-
group: "internal",
144-
pattern: "~/**",
145-
},
146-
{
147-
group: "internal",
148-
pattern: "@/**",
149-
},
150-
],
151141
},
152142
],
153143
"import/prefer-default-export": "off",
154144
"import/unambiguous": "off",
155145
},
156146

147+
settings: {
148+
"import/internal-regex": "^(?:@|~).+",
149+
},
150+
157151
overrides: [
158152
{
159153
files: ["**/*.cjs"],

0 commit comments

Comments
 (0)