-
Notifications
You must be signed in to change notification settings - Fork 344
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
Prefer to use node from environment #1727
Comments
To not break any existing users this would need to go behind a setting. However there is already a setting to make it the default which is |
@dbaeumer even though I just think it makes far more sense, and cause far less confusion for users. Most projects worth its salt also run linting in CI, where you would (almost) always use the node from enviroment. There is no concept of a "built-in" there. As such, for VS Code and the ESLint extension to mimic this, the default should be to get it from env in VS Code as well, to avoid users having to always configure To change the default obviously need some deprecation period/warning and a way for users to migrate. So that is something to figure out. |
It's already surprising to find that this extension defaults to vscode's node version, but doubly surprising that the answer is we're supposed to know to opt-in to the expected default by setting a poorly documented setting with a name that seems unrelated.
Not using the environment's node leads to eslint not loading its configuration successfully due to mismatched node version expectations. |
@runspired pointed out that we should also consider using node from the workspace / environement (if configured) instead of using the global node. |
I'm running into the same issue as @runspired and would love to see this resolved. |
#1596 (comment) mentioned:
@dbaeumer Why is the recommendation to use the one that comes with VS Code?
Most other linters and VS Code extensions I am aware of defaults to using the one "from environment".
Examples:
importStrategy
default isfromEnvironment
.It makes more sense to me at least. Each project, old or new, comes with a specific Node version. Imagine you work in multiple open source repositories. Most have a
.nvmrc
or a.node-version
file. If I jump around between these, the Node version and thus implicitly the ESLint features changes depending on this.To me the best solution would be to do like Ruff, where you fall back to the built-in one if you cannot find one from the environment:
Could this be considered?
The text was updated successfully, but these errors were encountered: