stylelint / vscode-stylelint

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

[Bug]: Not updating settings after editing the config file `.stylelintrc.json` #462

Open Profesor08 opened 1 year ago

Profesor08 commented 1 year ago

How did you encounter this bug?

Open some .css, .scss file with some errors. Disable or configure settings in .stylelintrc.json. No effect will be applied until full restart of vscode.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/typescript-emqgcv?file=style.scss,style.css,.stylelintrc.json

Code Snippet

$grey7: #222;
.elem {
  color: #222;
}

Stylelint Configuration

{
  "extends": "stylelint-config-standard-scss",
  "overrides": [
    {
      "files": ["*.scss", "**/*.scss"],
      "customSyntax": "postcss-scss"
    }
  ],
  "rules": {
    "color-hex-length": "long"
  }
}

Extension Configuration

"stylelint.validate": ["css", "scss"]

Actual Behaviour

No effect

Expected Behaviour

Settings to be applied

Logs

[Info  - 2:58:24 PM] [language-server] Registering module | module: "auto-fix"
[Info  - 2:58:24 PM] [language-server] Module registered | module: "auto-fix"
[Info  - 2:58:24 PM] [language-server] Registering module | module: "code-action"
[Info  - 2:58:24 PM] [language-server] Module registered | module: "code-action"
[Info  - 2:58:24 PM] [language-server] Registering module | module: "completion"
[Info  - 2:58:24 PM] [language-server] Module registered | module: "completion"
[Info  - 2:58:24 PM] [language-server] Registering module | module: "formatter"
[Info  - 2:58:24 PM] [language-server] Module registered | module: "formatter"
[Info  - 2:58:24 PM] [language-server] Registering module | module: "old-stylelint-warning"
[Info  - 2:58:24 PM] [language-server] Module registered | module: "old-stylelint-warning"
[Info  - 2:58:24 PM] [language-server] Registering module | module: "validator"
[Info  - 2:58:24 PM] [language-server] Module registered | module: "validator"
[Info  - 2:58:24 PM] [language-server] Starting language server
[Info  - 2:58:24 PM] [language-server] Registering handlers
[Info  - 2:58:24 PM] [language-server] Handlers registered
[Info  - 2:58:24 PM] [language-server] Language server started

Stylelint Version

15.10.2

vscode-stylelint Version

v1.2.4

Node.js Version

v20.3.1

Operating System

Windows

Windows Subsystem for Linux

No response

Code of Conduct

Profesor08 commented 1 year ago

May be it is reloading, but not updating errors highlight in files

ota-meshi commented 1 year ago

I can't reproduce your problem using stackblitz.

Profesor08 commented 1 year ago

@ota-meshi because there is no way to post bug without repo. But stackblitz or others, do not has extensions support. Just open file in vscode with installed extension.

vanowm commented 1 year ago

I'm experiencing the same issue. This issue only applied to already opened css files There is no command to restart the extension, so we have 5 options:

1) restart vscode 2) restart extension host 3) close and re-open each css file 4) change Language mode of each opened css file from css to anything else and then back to css 5) disable and then enable stylelint in the workspace configuration

None of these is ideal and it's just a hustle.

Workspace config file:

{
    "settings": {
        "stylelint.enable": true,
        "stylelint.configFile": ".stylelintrc.js"
    }
}

stylelint log doesn't show any new entries when .stylelintrc.js config file was modified and I'm unable activate more verbose logs with suggested

cmd /C "set NODE_ENV=development&&code"

because it opens a new window with NODE_ENV set to development, however once I open my project in that window, that variable is being removed.

vscode-stylelint: 1.2.4
Stylelint: 15.10.3
VSCode: 1.83.1
Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc
Date: 2023-10-10T23:48:05.904Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045