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

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

Open Profesor08 opened this issue 2 years ago • 6 comments

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

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

Profesor08 avatar Jul 21 '23 12:07 Profesor08

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

Profesor08 avatar Jul 21 '23 12:07 Profesor08

I can't reproduce your problem using stackblitz.

ota-meshi avatar Jul 21 '23 16:07 ota-meshi

@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.

Profesor08 avatar Jul 21 '23 16:07 Profesor08

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

vanowm avatar Oct 15 '23 15:10 vanowm