vscode-stylelint icon indicating copy to clipboard operation
vscode-stylelint copied to clipboard

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

Open hywebr00 opened this issue 2 years ago • 13 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

  • [X] I agree to follow vscode-stylelint's Code of Conduct

hywebr00 avatar May 14 '22 15:05 hywebr00

@hywebr00 Same problem here. Solved by resetting all vscode-stylelint extension settings in vscode

Mutueye avatar Dec 08 '22 08:12 Mutueye

@ota-meshi If I set configBasedir , vscode shows CssSyntaxError if I remove configBasedir, vscode noraml

Jackliu007888 avatar Jun 11 '23 10:06 Jackliu007888

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.

shubhamrawat090 avatar Mar 27 '24 16:03 shubhamrawat090

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

zeref-12 avatar Apr 10 '24 14:04 zeref-12

I am getting this error in html and md files in vs code.

pragyajha24 avatar Apr 11 '24 12:04 pragyajha24

related: hex-ci/vscode-stylelint-plus#35

Mouvedia avatar Apr 23 '24 22:04 Mouvedia

In VSCode go to settings > type 'Stylelint' > Stylelint + config > unchecked Stylelint: Enable.

tcode9563 avatar Apr 25 '24 09:04 tcode9563

In VSCode go to settings > type 'Stylelint' > Stylelint + config > unchecked Stylelint: Enable.

@tcode9563, thank you. This solved the problem

RantiBaba avatar Apr 29 '24 12:04 RantiBaba