-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
Provide integration wit stylelint #207
Comments
I'm not sure this would bring something more than only relying on stylelint in this case. Disclaimer: I don't know stylelint. Is there any project we could start of? (prettier-stylelint, ...) |
@CiGit Stylelint is very simialr to eslint, it checks for common problems in styles, and it also enforces some of the stylistic rules on how to format the CSS/SCSS files. For the list of stylelint rules, take a look here: https://stylelint.io/user-guide/rules/ The rules that can be fixed by stylelint ( As you see, Stylelint doesn't really reformat the whole files, it mostly does gentle things, like cases, empty lines, indents (some of these options are not available in prettier, which is probably not that bad in common case, but pretty bad in those cases when you are working on big projects and cannot change the rules and force everybody switch to prettier). Without this prettier/stylelint integration I can't really use prettier (and this plugin in VS Code) in some projects, since the SCSS output prettier produces basically breaks the build due to stylelint errors. With javascript files this is not a problem, since I can rely on prettier-eslint integration to fix the differences. I am not aware of any current project like |
Working on this, already have a basic version of a prettier-stylelint tool a few more tests and I'll do a PR here adding support for it. |
This seems to be done since a long time ... |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Now that prettier supports CSS/SCSS formatting, it would be really nice to integrate prettier-vscode with stylelint in a manner similar to what is done with eslint integration for JavaScript files.
Ideally, there should be a config option to enable/disable this integration (just like with eslint), so that the SCSS/CSS styles formatted with prettier are then auto-fixed via stylelint to confirm to stylelint rules.
Stylelint is adding more and more support for its
--fix
functionality.Here's one of the use cases I have: The source base I am working on has a stylelint rule that all color HEX values must be uppercase. Prettier formats the HEX values to be lowercase, which breaks stylelint checks.
And since prettier is an 'opinionated' formatter, it doesn't provide a way to configure this behavior.
The text was updated successfully, but these errors were encountered: