-
-
Notifications
You must be signed in to change notification settings - Fork 446
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Need help] Use Prettier 3 with stylelint #1051
Comments
@kanlukasz Have you tried |
As was mentioned above, you need to install |
For the sake of sanity and memorializing hours lost to this, some confusion about this is justified.
Additionally, like prettier-vscode, stylelint-prettier is a Prettier project and relatively active, while prettier-stylelint is independent and hasn't been updated since September 2017. (I could quibble about the names too, Prettier's project name start with "stylelint"?) All that aside, prettier-stylelint (the independent one) works as described. Here is a simplified, working example. (vscode Note: You might need to reload the VS Code window to get this working. package.json {
[name, description, etc...],
"devDependencies": {
"prettier": "^1.19.1",
"prettier-stylelint": "^0.4.2",
"stylelint": "^12.0.0"
},
"stylelint": {
"rules": {
"comment-empty-line-before": "always"
}
}
} Ugly input css .a {color: tomato;
/* comment */
padding: 2px; margin: 4px;} Resulting CSS after running Format Document (alt-shift-f): .a {
color: tomato;
/* comment */
padding: 2px;
margin: 4px;
} |
Sorry but this is confusing and really frustrating. I checked Would you mind sharing a config to make it work as expected and fix errors and apply order based on stylelint-config-twbs-bootstrap. Here's my previously working
For now I'm forced to revert back to v.2.3.0. |
@SharakPL Check that your config still works using just the Stylelint CLI. I was using some ordering configs which were having trouble after Stylelint's v12 release. It's also a good idea to remove the node_modules folder and re-install, I got stuck (for too long) with an outdated sub-dependency blocking a newer one. The code in my comment above yours does work. It's obviously reduced, but I have been able to use this foundation with a larger stylelint config. |
@joemaller as I mentioned before, stylelint works just fine, both CLI and through vscode extension. All errors and order warnings are linted, but prettier won't fix any of these and uses only its own rules. It works only with my above config, Edit: Had to disable prettier for ignoring my stylelint config and am now using VSCode's built-in autofix functionality:
|
Update - now stylelint has released an official vs code plugin. No more configuration problems, etc. |
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. |
Can someone show me how it works or how should I install it?
To be honest, I don't understand the documentation or I miss something. It drives me crazy 馃檮
Steps that i did:
npm install --save-dev stylelint
npm install --save-dev stylelint-prettier prettier
And what now? Prettier in VSCode didn't fix anything in css files
Or maybe I do it completely wrong? I don't understand this
Sorry, i know, it's repository, not a help page, but please help me if you can
I'm working on Windows 10 machine
The text was updated successfully, but these errors were encountered: