Comments (5)
FYI, I prefer line and inline #
-prefixed comment syntax because:
- it matches most of the other dot file comment syntaxes
- it should be simple to add parsing for it
- it doesn't appear to conflict with Node.js versions and alias syntax. Although, we would need to explicitly state that
#
is not allowed in custom Node.js aliases.
If it turns out that #
conflicts with the syntax of planned features (of which I am not aware of), then I'd favor only allowing line comments where the first character in the line is a #
. In other words, a line MUST start with a #
to be a comment and the entire line is ignored when determining the syntax of the rest of the file.
from nvm.
As a work-around, devs can add comments anywhere after the first line of .nvmrc
. It's possible those comments will break NVM in future versions and you'll have to remove them. Fortunately, my .nvmrc
comments explain why the comment may break NVM. π
This is what one of my projects' .nvmrc
file looks like:
v18.19
# Node.js v18.20 and v20.10 (and later) have a bug that causes Jest code
# coverage to randomly fail.
# TODO: Switch to "v18" or "v20" when this bug is fixed.
# https://github.com/nodejs/node/issues/51251
# Note: This is a non-standard .nvmrc comment. If these comments cause an error,
# see https://github.com/nvm-sh/nvm/issues/3336
from nvm.
Additional lines will be used in the future for additional configuration, so if you put comments there things will break for you - donβt do that.
from nvm.
Additional lines will be used in the future for additional configuration, so if you put comments there things will break for you - donβt do that.
That's why I called it a work-around while comments are still not officially supported.
from nvm.
Regarding the OP, it's an rc file, so the only two options that would make sense are ;
or #
- ie, ini or shell.
I think "shell" makes the most sense for nvm, so i'd say that "lines starting with #
", at a minimum, would be skipped, and thus would support comments. Whether it's necessary to add in "inline" comments is worth discussing, but I'm not sure it's particularly useful, and it adds extra complexity in case that character is ever actually needed.
from nvm.
Related Issues (20)
- Trivy Security scan error HOT 1
- [spam]
- [spam] HOT 1
- [spam] HOT 4
- Trivy Security scan error - Need proof HOT 2
- Feature Request: User-provided hash HOT 1
- Nvm fails to install on bitbucket pipelines sometimes HOT 2
- MacOS error for every new session: zsh: command not found: node HOT 5
- nvm alias default not working as expected HOT 3
- [spam]
- [spam]
- [spam]
- [spam]
- Make a link to install latest version? HOT 3
- Why are the results of `nvm use --lts` and `nvm use lts` different HOT 1
- Unable to install node version greater than 20 HOT 1
- Corepack and Yarn isolation in an nvm-managed environment HOT 2
- Can't use globally installed npm packages HOT 9
- Failed To Clone HOT 3
- Please add authentication support for NodeJS Dist mirrors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvm.