-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Spec for .nvmrc files? #3265
Comments
No, there’s no spec (just current behavior) and writing one without extreme care would preclude future enhancements, so I’m hesitant. The next version of nvm will ignore trailing lines (ie, only regard the first line) but I’d like to extend it in the future so it can contain additional information. The first line can contain any “version-ish”, iow, anything |
I suppose it's worth writing something up just do nobody does it wrong :-) for example anything that claims to support nvmrc but only supports version numbers, doesn't support nvmrc. I have no idea what that kind of spec would look like, though. Any thoughts? |
My hunch as someone who's never contributed to this repository or thought deeply about the space (😄) is that something short and to the point would work, provided it explicitly calls out what areas aren't yet solidified. Using RFC 2199's nomenclature:
...I've never written a technical spec for a file format or syntax before. 🙂 |
Makes sense. I'll give it a shot over the next week or two, and will probably also ship an npm package to validate the file. |
Why would i be disallowed to use
in .nvmrc? It is a valid version what |
Only because I did not know that was possible! 😄 The spec should be modified to allow that and any other intentionally allowed version specifiers. |
That's great. BTW my apologies for butting into this discussion. I would suspect the code of |
Yes, i would make sure anything nvm supports is allowed, which includes custom aliases. |
Alrighty, Officially, if this tool says it's valid, then your nvmrc file won't break in the future. If it says it's invalid, you're bad and you should feel bad, and you should fix it. Notably, this does not validate the content - iow, if you put See also, #3336 (comment) |
Swell, thanks! |
Coming over from prettier/prettier#15898 -> un-ts/prettier#340: I'd like to auto-format
.nvmrc
files (i.e. just remove trailing whitespace). It'd be helpful for any Prettier plugin that does this to be able to refer to a spec for.nvmrc
files. Is there anything like a specification that can be stated?For now, I'm just going with "it's the same output as
node -v
" which ... is a little informal.The text was updated successfully, but these errors were encountered: