I have such a row in my .env file:
REACT_APP_PLAID_MODE=sandbox # sandbox|development|production
And I get a REACT_APP_PLAID_MODE value, equal to:
sandbox # sandbox|development|production
instead of just:
Looks like there's no strict standards for this, each dotenv library vary from language to language. But it doesn't look like a normal behaviour. Look at Ruby's dotenv, etc. – they have it – you can use # for comments (not just for whole lines but for parts too), and ' & " symbols when need explicitly set a value (containing #)
We loosely follow the INI file format which supports comments on dedicated lines (not inline)
# sandbox|development|production
REACT_APP_PLAID_MODE=sandbox
Being able to have lines like
REACT_APP_PLAID_MODE=sandbox # sandbox|development|production
Is extremely useful because it encourages adding some documentation about the configuration to the same line as the config. It's not uncommon for unattached comments to become separated from the thing they are meant to comment on, and it allows end users to sort the file alphabetically (which makes it easier to find configs and duplicates) without fear of losing comments.
Yep. Another argument for using this approach - it's already supported widely
For example, vscode:

@maxbeatty, people want that :)
This kind of smug comment makes me not want to spend my free time writing and maintaining software for others.
@maxbeatty Would you be open to a PR that adds support for inline comments?