Skip to content

Commit f613385

Browse files
fix: update import rules
1 parent 157ae27 commit f613385

File tree

1 file changed

+21
-41
lines changed

1 file changed

+21
-41
lines changed

src/plugins/import.ts

+21-41
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,27 @@ import { commonJsFiles, jsExtensions, typescriptFiles } from "~/files";
55
export const settings: Linter.Config = {
66
plugins: ["import"],
77

8-
extends: ["plugin:import/errors", "plugin:import/warnings"],
8+
extends: ["plugin:import/recommended"],
99

1010
rules: {
11+
"import/consistent-type-specifier-style": ["error", "prefer-inline"],
1112
"import/default": "error",
12-
"import/dynamic-import-chunkname": [
13-
"off",
13+
"import/dynamic-import-chunkname": "off",
14+
"import/export": "error",
15+
"import/exports-last": "off",
16+
"import/extensions": [
17+
"error",
18+
"always",
1419
{
15-
importFunctions: [],
16-
webpackChunknameFormat: "[0-9a-zA-Z-_/.]+",
20+
js: "never",
21+
ts: "never",
22+
cts: "never",
23+
cjs: "never",
24+
mts: "always",
25+
mjs: "always",
26+
json: "always",
1727
},
1828
],
19-
"import/export": "error",
20-
"import/exports-last": "off",
21-
"import/extensions": "off",
2229
"import/first": "error",
2330
"import/group-exports": "off",
2431
"import/max-dependencies": [
@@ -37,30 +44,15 @@ export const settings: Linter.Config = {
3744
"import/newline-after-import": "error",
3845
"import/no-absolute-path": "error",
3946
"import/no-amd": "error",
40-
"import/no-anonymous-default-export": [
41-
"off",
42-
{
43-
allowAnonymousClass: false,
44-
allowAnonymousFunction: false,
45-
allowArray: false,
46-
allowArrowFunction: false,
47-
allowLiteral: false,
48-
allowObject: false,
49-
},
50-
],
47+
"import/no-anonymous-default-export": "off",
5148
"import/no-commonjs": "off",
5249
// Should be safe when bundling.
5350
"import/no-cycle": "off",
54-
// "import/no-cycle": [
55-
// "error",
56-
// {
57-
// ignoreExternal: true,
58-
// },
59-
// ],
6051
"import/no-default-export": "off",
6152
"import/no-deprecated": "warn",
62-
"import/no-duplicates": "error",
53+
"import/no-duplicates": ["error", { "prefer-inline": true }],
6354
"import/no-dynamic-require": "error",
55+
"import/no-empty-named-blocks": "error",
6456
"import/no-extraneous-dependencies": [
6557
"error",
6658
{
@@ -93,12 +85,7 @@ export const settings: Linter.Config = {
9385
peerDependencies: true,
9486
},
9587
],
96-
"import/no-internal-modules": [
97-
"off",
98-
{
99-
allow: [],
100-
},
101-
],
88+
"import/no-internal-modules": "off",
10289
"import/no-mutable-exports": "error",
10390
"import/no-named-as-default": "off",
10491
// using unicorn/import-style for per package control
@@ -111,19 +98,12 @@ export const settings: Linter.Config = {
11198
"import/no-restricted-paths": "off",
11299
"import/no-self-import": "error",
113100
"import/no-unassigned-import": "error",
114-
"import/no-unused-modules": [
115-
"off",
116-
{
117-
ignoreExports: [],
118-
missingExports: true,
119-
unusedExports: true,
120-
},
121-
],
101+
"import/no-unused-modules": "off",
122102
"import/no-useless-path-segments": [
123103
"error",
124104
{
125105
commonjs: true,
126-
noUselessIndex: false,
106+
noUselessIndex: true,
127107
},
128108
],
129109
"import/no-webpack-loader-syntax": "error",

0 commit comments

Comments
 (0)