vscode-stylelint throws an using this as a plugin
See original GitHub issueFirstly, I’m not sure if this is an issue with the vscode plugin or with stylelint-config-rational-order
but I needed to start somewhere.
When I enable this by extending the stylelint config it works perfectly.
{
"extends": [
"stylelint-config-rational-order"
]
}
However if I enable it as a plugin and rule the vscode plugin throws an error about severity, see the below error.
{
"plugins": [
"stylelint-config-rational-order/plugin"
],
"rules": {
"plugin/rational-order": true
// OR (both break)
// "plugin/rational-order": [true, {
// "border-in-box-model": false,
// "empty-line-between-groups": false,
// }]
}
}
Error: `severity` property of a stylelint warning must be either 'error' or 'warning', but it was 'ignore' (string). at stylelintWarningToVscodeDiagnostic (/Users/ben/.vscode/extensions/shinnn.stylelint-0.48.0/node_modules/stylelint-warning-to-vscode-diagnostic/index.js:40:9) at Array.map (<anonymous>) at processResults (/Users/ben/.vscode/extensions/shinnn.stylelint-0.48.0/node_modules/stylelint-vscode/index.js:59:18) at stylelintVSCode (/Users/ben/.vscode/extensions/shinnn.stylelint-0.48.0/node_modules/stylelint-vscode/index.js:144:9)
I tried adding the severity option but the error is still throw.
"plugin/rational-order": [true, { "severity": "warning" } ]
Any ideas where this problem exists or how to fix it?
BTW I love this project, thank you 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
vscode-stylelint - Visual Studio Marketplace
This extension provides an action that you can use with VS Code's editor.codeActionsOnSave setting. If provided a source.fixAll.stylelint ...
Read more >Options - Stylelint
... PostCSS plugin. You can use some of these options in the configuration object. ... Stylelint does not throw an error when glob...
Read more >Can't get VS Code Stylelint extension to lint in .ts files
I've already opened an issue in the VS Code Github repo but it got closed immediately. The extension itself has disabled the possibility...
Read more >Atom Integration with Prettier and Stylelint. | by Mark Kiptubei
... eslint and stylelint with VSCode a popular editor from Microsoft . ... Atom relies extensively on npm for its plugins so its...
Read more >Tooling - styled-components
If you do not use this plugin and try to server-side render ... When using this processor a couple of stylelint rules throw...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ben, thank you for paying attention to this wrong behavior! My mistake =) The documentation was fixed. So to fix the error just follow the steps:
npm install --save-dev stylelint stylelint-order stylelint-config-rational-order
stylelint-order
to plugins"order/properties-order": []
to rulesThat’s all =)
So it will look:
or (also will work):
If there are 11 or more rules, not placing
"order/properties-order": [],
first seems to still produce this error.This .stylelintrc will show the ‘severity’ error:
This .stylelintrc works fine (
"order/properties-order": [],
is first):This .stylelintrc also works fine (only 10 rules):