Some eslint plugins crash without NODE_ENV
See original GitHub issueCurrently it’s impossible to use vscode-eslint with any plugin that needs NODE_ENV
because there’s no way to define it.
The ideal solution would be to expose a eslint.nodeEnv
setting, or a more generalized eslint.processEnv
setting, so that users can define whatever environment variables are needed by their eslint plugins.
Example:
[eslint-import-resolver-babel-module] Error: Using
babel-preset-razzle
requires that you specifyNODE_ENV
orBABEL_ENV
environment variables. Valid values are “development”, “test”, and “production”. Instead, received: undefined.
This is essentially the same issue as #741, but for some reason, that issue was closed when a platform-dependent workaround was found (which didn’t address the underlying root cause). Clearly, defining NODE_ENV
for the entire VS Code process is overkill and not really a viable solution, as doing so is likely to cause other problems.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (7 by maintainers)
Thanks a lot @mattlubner, I’m using
eslint-import-resolver-babel-module
also with a custombabel
config that requires a customNODE_ENV
, so this feature will greatly improve my workflow 😄.@dbaeumer, do you have an ETA for a new version of the extension containing this feature ?
Thanks again for all your work !
I merged the PR. Will look into a new version when we ship a new version of VS Code beginning of August.