stylelint / vscode-stylelint

The official Visual Studio Code extension for Stylelint

Home Page:https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Unknown word (CssSyntaxError)Stylelint(CssSyntaxError)

hywebr00 opened this issue · comments

How did you encounter this bug?

"Unknown word" on JavaScript file imports

error image

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

  • 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

Screenshot 2024-03-27 214048
Screenshot 2024-03-27 214109
Screenshot 2024-03-27 214158
Check if you have any other stylelint extensions installed like stylelint-plus. Uninstall it and install the official stylelint. That worked for me.

Th

Screenshot 2024-03-27 214048 Screenshot 2024-03-27 214109 Screenshot 2024-03-27 214158 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.

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