marioparaschiv / import-sorter

📚 Sort your JS/TS imports in a consistent and configurable order.
GNU General Public License v3.0
0 stars 0 forks source link

File ignore #1

Open Digital39999 opened 1 month ago

Digital39999 commented 1 month ago

Hi! First of all, I've been looking for some sorting extension like this for so looong, I can't describe how happy I am this exists.

Would you mind adding a way to ignore files? Like if I have something that needs to be explicitly imported at the top as import '../file';.

I was thinking of something like adding a check if file starts with or includes /* import-sort disable */ that it skips the parsing here similarly to eslint or typescript ignore. Thanks.

marioparaschiv commented 1 month ago

I was just working on this :)

Digital39999 commented 1 month ago

You're fast haha, thanks, I was working on some project and got annoyed from always sorting imports manually so i went on the search for like 10th time and I see this new repo. Glad to be one of the first.

Digital39999 commented 1 month ago

And I'm afraid change you did made it not register settings anymore.

marioparaschiv commented 1 month ago

And I'm afraid change you did made it not register settings anymore.

Screenshot 2024-10-06 at 15 51 49

It shows up fine for me. Could you double check?

Digital39999 commented 1 month ago

It does show up fine for me, but when i untick these 2 checks for sorting and set new line count to 1, it still stays at default settings.

marioparaschiv commented 1 month ago

I've published a new version fixing this. Thank you for reporting this :)

Digital39999 commented 1 month ago

I've published a new version fixing this. Thank you for reporting this :)

Haven't had a chance to test until now, works perfectly, thanks. Is there a way to sort like this below if line is too long? Because then it just gets so long that manually importing something or changing the import paths is difficult.

image (inside ones are sorted by length too, maybe some setting for max like length)

image or even like this

marioparaschiv commented 1 month ago

Please open a new issue for that.