Closed GasparAdragna closed 1 week ago
This behavior is expected. The plugin compares the values and sorts them alphabetically.
['@', '.'].sort() // ['.', '@']
In your case, you can only separate the component imports into two separate groups.
There is no way of ordering them as a group? I dont get why i can group them but not order them, seems counterintuitive .
I would like to group all of my components into a single group
There is currently no such opportunity. If we had such a feature, what might the configuration look like?
Perhaps you have some ideas how it should be configured.
Thanks for the fast replies, i only have one more question.
Why if its sorting correctly (first '.' and then '@'), its showing them in the oposite way?
When i save the file i can see that it "jumps" from the correct order to the one i show in the picture. I don’t know if something is overriding the configuration but i cannot find anything that might interfere .
Imports that start with a .
alphabetically go earlier than those that start with a @
.
Perhaps we should in the future add the ability to create subgroups that would sort values within groups, given the order defined within them.
Describe the bug
Im having a problem with the auto-sorting of the imports.
I have a custom group like so:
"components": ["@components/**", "./components/**"],
But the alphabetical sorting is doing it individually, once for @components and then for ./components
Code example
This is the rest of the .eslintrc.json:
ESLint version
8.54
ESLint Plugin Perfectionist version
2.9.0
Additional comments
No response
Validations