hint icon indicating copy to clipboard operation
hint copied to clipboard

[Bug][VS Code extension] Environment variables are not respected

Open ronvoluted opened this issue 3 years ago • 0 comments

🐞 Bug report

Description

Setting environment variables is not causing properties to be applied within webhint. Process follows user guide on configuring properties with environment variables.

Details

Windows 10 64-bit VS Code 1.63.2 webhint v1.6.4

Env var name: webhint_browserslist Env var value: tried defaults not IE 11, defaults and not IE 11, and defaults, not IE 11

Fully closed/re-launched VS Code after setting the env var, and also checked that the env var exists through the VS Code terminal. This is with no .hintrc file. If I do add one with the following contents it works great as intended, the properties apply and hints appear correctly in the Problems tab of VS Code.

{
  "browserslist": [
    "defaults",
    "not IE 11"
  ]
}

I was also originally testing this via the Microsoft Edge Tools for VS Code extension, which includes webhint by default. Env vars didn't work there either. The above details are with the MS Edge Tools uninstalled, and the standalone webhint extension installed.

The goal is to have a global config applied for webhint, rather than adding .hintrc files to every project. This issue in microsoft/vscode-edge-devtools relates.

ronvoluted avatar Dec 30 '21 08:12 ronvoluted