-
Notifications
You must be signed in to change notification settings - Fork 210
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
Add support for comments in version files like .nvmrc #175
Comments
Does There is a long discussion at nodejs/version-management#13 about agreeing on a standard format for a file that specifies the node version for a project, however there was no consensus reached. Without agreement there, I would hesitate to extend support for more options in that file. |
Absolutely nvm does not support comments; the only thing it can contain is an nvm-style "version-ish", with perhaps a trailing newline. |
I've noticed that neither What about settling for an unofficial support via less strict parsing? |
Yes, it would be make sense to ignore any following lines after the first. (No need for a setting.) |
fwiw I'm far more likely to change nvm to error on extra lines being present, in order to preserve the design space - iow, to make the parsing stricter. |
@ljharb How about warning for now and then do a breaking change to error (probably at the same time as the rest of the file standard is defined) since the contract isn't currently defined? I'm imagining this would mean that current users won't have a broken experience as soon as they upgrade I do appreciate this adds a little bit of complexity in the mean time. @jasongin As for how |
please add support for comments i don't get it why it was not done in the early stage. its like very basic requirement of any config file |
The core config file of the node ecosystem has never had comments, so i don’t think it’s as basic as you’re claiming. |
It's often called out as a missing feature. The trend within the ecosystem seems to be moving towards more expressive configuration with .json -> .js |
i hear you. I’m just saying that package.json doesn’t have comments and it’s fine. i don’t personally find it confusing - what else would 18 and “nvm” mean - but that’s subjective. |
junior developer |
I would like to add a reason for sticking to a specific node version. In our case, we need the experimental-specifier-resolution option that was removed in node 19, so we're stuck with node 18. I'd love to be able to state this reason where the setting is instead of the README. Can do without; would like to have the comment at the setting it explains. |
There are also options to define the version more general than just with a distinct version number. |
I recently came across a project with a
.nvmrc
file with a comment in it which is useful to tell maintainers that unfortunately it's not the single source of truth (due to it being duplicated in apom.xml
that uses frontend-maven-plugin). Could support be added to ignore anything after a version number that comes at the start of the file?cat .nvmrc
12.18.0
# note to update the pom.xml node version too
The text was updated successfully, but these errors were encountered: