-
-
Notifications
You must be signed in to change notification settings - Fork 41
[feat]: apply alphabetize
for same group or a new option alphabetizeInGroup: true
#129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Reproduction please. |
@JounQin here you go. If you run
Hit save (assuming you have format on save set) and you'll see it reformat to the following:
Ideally, it would reformat to this instead:
If you actually move |
Can you provide a GitHub repo for reproduction instead of |
@JounQin sure, here you go: https://github.com/reintroducing/import-plugin |
Is this a regression or a feature you want? |
In current implement and with your config, {
"pattern": "../**/*.scss",
"group": "index",
"patternOptions": {
"matchBase": true,
},
"position": "after",
},
{
"pattern": "./**/*.scss",
"group": "index",
"patternOptions": {
"matchBase": true,
},
"position": "after",
} |
I’ve not used this plugin long enough to know if it’s a regression so I suppose you can say it’s something I was hoping can be done based on the configs (and specifically my config which I thought would have covered that case). Based on the config I guess I don’t understand why files located as close to the source as possible wouldn’t come last in the order. |
But that config would then need to be made for every level possible of CSS paths relative to the file. That seems anti what it should do |
Nope, |
Ah, ok, I’ll give that a try, thank you! |
On the other hand, maybe we should sort by |
alphabetize
for same group or a new option alphabetizeInGroup: true
For whoever wants to work on this, I've added a failing test case at #260, feel free to contribute on this! |
@JounQin for what its worth, I just tried the config you suggested and that does indeed fix my original issue, so thank you. I did add another scss file one level higher to test, and subsequently got this on saving:
Is there a way to force scss files to always be last? i thought the rules being last would have forced them to be last in the order, but as you can see one of the types ( |
Just a thought not tested, you could define your own |
I apologize but I'm not sure I understand what you mean. |
Sorry, there is a typo, I mean you should build your own |
Hello,
I'm trying to figure out something that I can't seem to get a handle on. I have the plugin working mostly as i want except for one annoyance. In the following imports:
The last two should be reversed. I'd like the output to be:
so that the most local scss import is last (it has caused some issues in overriding classes). My config is as follows:
I can't seem to nail down the proper config to get this working as I'd like. what am i missing to get this sorting properly?
Thank you for your help.
The text was updated successfully, but these errors were encountered: