Skip to content

Commit 723a40d

Browse files
fix: update import rules for apps
1 parent 83cf882 commit 723a40d

File tree

1 file changed

+52
-37
lines changed

1 file changed

+52
-37
lines changed

src/configs/imports.ts

+52-37
Original file line numberDiff line numberDiff line change
@@ -89,42 +89,6 @@ export async function imports(
8989
"import/no-duplicates": ["error", { "prefer-inline": true }],
9090
// "import/no-dynamic-require": "off",
9191
"import/no-empty-named-blocks": "error",
92-
"import/no-extraneous-dependencies": [
93-
"error",
94-
{
95-
bundledDependencies: true,
96-
devDependencies: [
97-
`?(.)*.${GLOB_SRC_EXT}`,
98-
`?(.)config?(s)/**`,
99-
"**/?(.)script?(s)/**",
100-
"**/spec/**",
101-
"**/test?(s)/**",
102-
"**/__mocks__/**",
103-
"**/__tests__/**",
104-
`**/*{.,_}{test,spec}.${GLOB_SRC_EXT}`,
105-
`**/Gruntfile{,.${GLOB_SRC_EXT}`,
106-
`**/gulpfile.${GLOB_SRC_EXT}`,
107-
`**/gulpfile.*.${GLOB_SRC_EXT}`,
108-
`**/jest.config.${GLOB_SRC_EXT}`,
109-
`**/jest.setup.${GLOB_SRC_EXT}`,
110-
`**/karma.conf.${GLOB_SRC_EXT}`,
111-
`**/postcss.config.${GLOB_SRC_EXT}`,
112-
`**/protractor.conf.${GLOB_SRC_EXT}`,
113-
`**/protractor.conf.*.${GLOB_SRC_EXT}`,
114-
`**/rollup.config.${GLOB_SRC_EXT}`,
115-
`**/rollup.config.*.${GLOB_SRC_EXT}`,
116-
`**/tailwind.config.${GLOB_SRC_EXT}`,
117-
`**/tailwind.config.*.${GLOB_SRC_EXT}`,
118-
`**/vite.config.${GLOB_SRC_EXT}`,
119-
`**/vitest.config.${GLOB_SRC_EXT}`,
120-
`**/vue.config.${GLOB_SRC_EXT}`,
121-
`**/webpack.config.${GLOB_SRC_EXT}`,
122-
`**/webpack.config.*.${GLOB_SRC_EXT}`,
123-
],
124-
optionalDependencies: true,
125-
peerDependencies: true,
126-
},
127-
],
12892
// "import/no-internal-modules": "off",
12993
"import/no-mutable-exports": "error",
13094
// "import/no-named-as-default": "off",
@@ -209,9 +173,60 @@ export async function imports(
209173
},
210174
],
211175
"import/no-useless-path-segments": ["error", { noUselessIndex: false }],
176+
177+
"import/no-extraneous-dependencies": [
178+
"error",
179+
{
180+
bundledDependencies: true,
181+
devDependencies: [
182+
`?(.)*.${GLOB_SRC_EXT}`,
183+
`?(.)config?(s)/**`,
184+
"**/?(.)script?(s)/**",
185+
"**/spec/**",
186+
"**/test?(s)/**",
187+
"**/__mocks__/**",
188+
"**/__tests__/**",
189+
`**/*{.,_}{test,spec}.${GLOB_SRC_EXT}`,
190+
`**/Gruntfile{,.${GLOB_SRC_EXT}`,
191+
`**/gulpfile.${GLOB_SRC_EXT}`,
192+
`**/gulpfile.*.${GLOB_SRC_EXT}`,
193+
`**/jest.config.${GLOB_SRC_EXT}`,
194+
`**/jest.setup.${GLOB_SRC_EXT}`,
195+
`**/karma.conf.${GLOB_SRC_EXT}`,
196+
`**/postcss.config.${GLOB_SRC_EXT}`,
197+
`**/protractor.conf.${GLOB_SRC_EXT}`,
198+
`**/protractor.conf.*.${GLOB_SRC_EXT}`,
199+
`**/rollup.config.${GLOB_SRC_EXT}`,
200+
`**/rollup.config.*.${GLOB_SRC_EXT}`,
201+
`**/tailwind.config.${GLOB_SRC_EXT}`,
202+
`**/tailwind.config.*.${GLOB_SRC_EXT}`,
203+
`**/vite.config.${GLOB_SRC_EXT}`,
204+
`**/vitest.config.${GLOB_SRC_EXT}`,
205+
`**/vue.config.${GLOB_SRC_EXT}`,
206+
`**/webpack.config.${GLOB_SRC_EXT}`,
207+
`**/webpack.config.*.${GLOB_SRC_EXT}`,
208+
],
209+
optionalDependencies: true,
210+
peerDependencies: true,
211+
},
212+
],
212213
},
213214
},
214215
]
215-
: []) satisfies FlatConfigItem[]),
216+
: options.mode === "application"
217+
? [
218+
{
219+
files: [GLOB_SRC],
220+
rules: {
221+
"import/no-unassigned-import": [
222+
"error",
223+
{
224+
allow: ["**/*.?(s)css"],
225+
},
226+
],
227+
},
228+
},
229+
]
230+
: []) satisfies FlatConfigItem[]),
216231
];
217232
}

0 commit comments

Comments
 (0)