Skip to content

Commit d846e62

Browse files
committedApr 24, 2025
fix: update import groups in perfectionist config for better organization
1 parent 46f9c08 commit d846e62

File tree

1 file changed

+34
-9
lines changed

1 file changed

+34
-9
lines changed
 

‎src/configs/perfectionist.ts

+34-9
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,41 @@ export function perfectionist(): TypedFlatConfigItem[] {
2222
'warn',
2323
{
2424
groups: [
25-
'builtin',
26-
'external',
27-
'type',
28-
['internal', 'internal-type'],
29-
['parent', 'sibling', 'index'],
30-
['parent-type', 'sibling-type', 'index-type'],
31-
'object',
32-
'side-effect',
25+
// Side effect style imports (e.g. 'normalize.css')
3326
'side-effect-style',
34-
'style',
27+
// Styles (e.g. *.{css,scss,less})
28+
'value-style',
29+
// Node.js built-in modules. (e.g. fs, path)
30+
'value-builtin',
31+
// External modules installed in the project (e.g. vue, lodash)
32+
'value-external',
33+
// Node.js subpath imports (e.g. fs/promises)
34+
'value-subpath',
35+
// Internal modules (e.g. @/utils, @/components)
36+
'value-internal',
37+
// Modules from parent directory (e.g. ../utils)
38+
'value-parent',
39+
// Modules from the same directory (e.g. ./utils)
40+
'value-sibling',
41+
// Main file from the current directory (e.g. ./index)
42+
'value-index',
43+
// TypeScript import-equals imports (e.g. import log = console.log)
44+
'ts-equals-import',
45+
// Side effect imports (e.g. import 'babel-polyfill')
46+
'side-effect',
47+
/**
48+
* Type import at the end
49+
*/
50+
'type-builtin',
51+
'type-external',
52+
'type-subpath',
53+
'type-internal',
54+
'type-parent',
55+
'type-sibling',
56+
'type-index',
57+
/**
58+
* Imports that don’t fit into any other group
59+
*/
3560
'unknown',
3661
],
3762
internalPattern: ['^[~@#]/.*'],

0 commit comments

Comments
 (0)