-
Notifications
You must be signed in to change notification settings - Fork 632
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
feat(fmt): enable setColorEnabled
in browsers
#3485
Conversation
Allowed for programmatic override of enable color
This makes sense to me. Does anyone have any concerns? |
Changes for browsers make sense, but if the runtime is Deno, maybe we still want to keep that if block (to prevent accidentally enable the color in that case) How about using |
That sounds like a good alternative. I will change the code accordingly. |
@kt3k Also, for this condition
Wouldn't it be better to change it to
To have this as opt out rather than opt in? |
I think that would make sense, but I'm not sure about the exact reasoning. @nayeemrmn Do you remember why |
It was because browser consoles don't support ANSI sequences. Though I just checked and apparently Chromium does (now?)! But Firefox doesn't. I'm in favour of enabling it by default |
Updated according to our discussion, but let me know if there is anything else |
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.
LGTM 👍
Allowed for programmatic override of enable color.
When Deno is not available in global this, and we want to use the colors library in e.g. browsers without shiming (dnt), it is not possible to view colors in the console, or set it to enabled. This pr changes this behavior so that it is possible to programmatically override the enable variable.