stylelint / vscode-stylelint

The official Visual Studio Code extension for Stylelint
https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
MIT License
318 stars 31 forks source link

Error not recognised in vscode #451

Open AprildreamMI opened 1 year ago

AprildreamMI commented 1 year ago

What steps are needed to reproduce the bug?

  1. npm init stylelint
  2. Create layout.css file
    
    .text * { top: calc(1em+ 2em);}

a{}

h1 { background-size: 0,0; }


### What Stylelint configuration is needed to reproduce the bug?

{ "extends": [ "stylelint-config-standard" ], "rules": { "value-list-comma-space-after": "always" } }


### How did you run Stylelint?

vscode

### Which version of Stylelint are you using?

15.4.0

### What did you expect to happen?

```json
{
  "name": "stylelint-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "stylelint": "^15.4.0",
    "stylelint-config-standard": "^32.0.0"
  }
}

What actually happened?

Error not recognised in vscode(1.77.0), no red wavy line

Does the bug relate to non-standard syntax?

no

Proposal to fix the bug

No response

AprildreamMI commented 1 year ago

image image

AprildreamMI commented 1 year ago

Found the reason, it's so strange that "stylelint.config": {} cannot exist in vscode's settings file

# settings.json
{
"stylelint.config": {}
}

The presence of this line will disable stylelint, but why this line is generated is completely beyond me

mattxwang commented 1 year ago

Hi @AprildreamMI, I've transferred this issue to the VSCode extension repository (from the main one).

For what it's worth, I'm not able to reproduce your example from a brand-new VSCode installation (ex download VSCode -> install plugin -> run npm init stylelint -- nothing is produced in the config for me / it works as intended). Is it possible that you've previously changed the setting?