-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
tty: treat empty NO_COLOR
same as absent NO_COLOR
#58074
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58074 +/- ##
==========================================
- Coverage 90.21% 90.21% -0.01%
==========================================
Files 630 630
Lines 186391 186391
Branches 36608 36608
==========================================
- Hits 168161 168150 -11
- Misses 11052 11061 +9
- Partials 7178 7180 +2
🚀 New features to boost your workflow:
|
@@ -82,9 +82,9 @@ function warnOnDeactivatedColors(env) { | |||
if (warned) | |||
return; | |||
let name = ''; | |||
if (env.NODE_DISABLE_COLORS !== undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These entries could (IMO should) all be simplified by just checking for truthiness. An env may only be undefined
or a string due to the internal setter, no matter that e.g., null
is assigned. It would result in 'null'
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it again: a user may pass through arbitrary values as environment variables. If a zero would for example be passed through, it would now be handled as not defined, while it would be picked up as process.env (being transformed to a string before).
So maybe we should just handle it as the stringified version? As in: env.FOO?.toString()
? I am somewhat indecisive about how to handle this case ideally.
@BridgeAR is it semver-major or just a fix? Wdyt about not landing it on LTS release lines to minimize the risk of ecosystem breakage, but still land it on Current release line? |
@aduh95 I think it's fine to land it on 24 or do you mean any release before? |
As specified in https://no-color.org/, setting the env variable to an empty string should result in that env variable to be ignored: