-
Notifications
You must be signed in to change notification settings - Fork 25
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
Imports with only a path are not sorted (.css files, etc) #188
Comments
I've retrieved a couple of issues over at tailwind that conflict with the sort plugin, but they're all marked as fixed, and I'm not quite sure if the issue is related to regular expressions or the plugin itself |
Hey @Soecka this is a recurring confusion, (and I think we need something more than documentation to explain it @IanVS) In short, reorganizing CSS file-imports runs the risk of changing the CSS cascade which could change the look of your code. (Unless you have very specific conventions in how you write CSS). And as a more general issue, imports without imported-names are by-definition being imported to cause a side-effect (whether it’s hooking in polyfills into global scope or something else). So it’s unsafe for this plugin to move stuff around an import that doesn’t import any variables (all imports can have side-effects, but compromising was necessary to make any tool like this one work at all). Other similar tickets: |
Thanks for the reply, I assume it was a tailwind plugin conflict, should have searched for related issues in this repository first! |
Thanks @fbartho. I've pinned this issue, hopefully that will help a little. We can also maybe update the issue template to mention this as well, because indeed it seems to trip up a lot of people. |
Your Environment
Describe the bug
import '../styles/main.css';
didn't sort into the bottomTo Reproduce
when I format with prettier, I got this below
Expected behavior
Screenshots, code sample, etc
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
.prettierrc
Error log
Contribute to @ianvs/prettier-plugin-sort-imports
The text was updated successfully, but these errors were encountered: