Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
Profesor08 opened this issue Jul 21, 2023 · 4 comments
Open
1 task done
Labels
status: needs reproducible example triage needs reproducible demo or repo type: bug a problem with a feature or rule

Comments

@Profesor08
Copy link

Profesor08 commented Jul 21, 2023

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

  • I agree to follow vscode-stylelint's Code of Conduct
@Profesor08 Profesor08 added the type: bug a problem with a feature or rule label Jul 21, 2023
@Profesor08
Copy link
Author

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

@ota-meshi
Copy link
Member

I can't reproduce your problem using stackblitz.

@ota-meshi ota-meshi added the status: needs reproducible example triage needs reproducible demo or repo label Jul 21, 2023
@Profesor08
Copy link
Author

Profesor08 commented Jul 21, 2023

@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
Copy link

vanowm commented Oct 15, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproducible example triage needs reproducible demo or repo type: bug a problem with a feature or rule
Projects
None yet
Development

No branches or pull requests

3 participants