vscode-stylelint
vscode-stylelint copied to clipboard
[Bug]: Unknown word (CssSyntaxError)Stylelint(CssSyntaxError)
How did you encounter this bug?
"Unknown word" on JavaScript file imports
Code Snippet
No response
Stylelint Configuration
{ "extends": [ "stylelint-config-recommended", "stylelint-config-styled-components" ], "plugins": ["stylelint-order"], "rules": { "at-rule-no-unknown": [ true, { "ignoreAtRules": [ "extend", "at-root", "debug", "warn", "error", "if", "else", "for", "each", "while", "mixin", "include", "content", "return", "function" ] } ], "color-hex-length": "long", "order/order": ["custom-properties", "declarations"], "order/properties-alphabetical-order": true } }
Extension Configuration
{
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"stylelint.snippet": ["css", "scss", "less", "postcss", "javascript"],
"stylelint.validate": ["css", "scss", "less", "postcss", "javascript"],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
}
}
Actual Behaviour
I need to lint my javascript files writing for styled-components, but always failed.
VS-Code version: Version: 1.67.1 for Apple Silicon
Stylelint version: v1.2.2
Expected Behaviour
I hope I can lint my styled-component's files.
Logs
No response
Stylelint Version
1.2.2
vscode-stylelint Version
1.6.71
Node.js Version
14.16.0
Operating System
macOS 12.3.1
Windows Subsystem for Linux
No response
Code of Conduct
- [X] I agree to follow vscode-stylelint's Code of Conduct
@hywebr00 Same problem here. Solved by resetting all vscode-stylelint extension settings in vscode
@ota-meshi If I set configBasedir , vscode shows CssSyntaxError if I remove configBasedir, vscode noraml
Check if you have any other stylelint extensions installed like stylelint-plus. Uninstall it and install the official stylelint. That worked for me.
Th
![]()
![]()
Check if you have any other stylelint extensions installed like stylelint-plus. Uninstall it and install the official stylelint. That worked for me.
Thankyou man, this was a very frustrating error
I am getting this error in html and md files in vs code.
Related on Stack Overflow: Unknown word (CssSyntaxError)stylelint(CssSyntaxError) on all my files in vscode
related: hex-ci/vscode-stylelint-plus#35
In VSCode go to settings > type 'Stylelint' > Stylelint + config > unchecked Stylelint: Enable.
In VSCode go to settings > type 'Stylelint' > Stylelint + config > unchecked Stylelint: Enable.
@tcode9563, thank you. This solved the problem