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

eslint.options.env is not respected #676

Closed
loilo opened this issue May 11, 2019 · 2 comments
Closed

eslint.options.env is not respected #676

loilo opened this issue May 11, 2019 · 2 comments

Comments

@loilo
Copy link

loilo commented May 11, 2019

When configuring default options for ESLint through VSCode options, the env option is ignored:

// VSCode settings
{
  "eslint.options": {
    "rules": {
      "no-undef": ["error"]
    },
    "env": {
      "browser": true
    }
  }
}
// Any JavaScript file, errors with "'alert' is not defined"
alert('baz')

Notes:

A reproduction repository can be found at loilo/repro-vscode-eslint-676.

@dbaeumer
Copy link
Member

Actually this is a quirk in npm ESLint itself. In the options for the CLIEngine this is called envs not env. See https://eslint.org/docs/developer-guide/nodejs-api#cliengine

@loilo
Copy link
Author

loilo commented May 14, 2019

Weird. Thanks for investigating!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants