Skip to content
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

fix: support NO_COLOR for ts diagnostics #220

Merged
merged 1 commit into from
Sep 26, 2022
Merged

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Sep 26, 2022

Closes #213

@dsherret dsherret merged commit 33aafc6 into main Sep 26, 2022
@dsherret dsherret deleted the no_color_diagnostics branch September 26, 2022 20:41
Comment on lines +12 to +14
const output = Deno.env.get("NO_COLOR") == null
? ts.formatDiagnosticsWithColorAndContext(diagnostics, host)
: ts.formatDiagnostics(diagnostics, host);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deno.noColor can be used so that dnt doesn't require additional permissions to access the environment variable

Suggested change
const output = Deno.env.get("NO_COLOR") == null
? ts.formatDiagnosticsWithColorAndContext(diagnostics, host)
: ts.formatDiagnostics(diagnostics, host);
const output = Deno.noColor
? ts.formatDiagnostics(diagnostics, host)
: ts.formatDiagnosticsWithColorAndContext(diagnostics, host);

Copy link
Member Author

@dsherret dsherret Sep 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't know about this property. Thanks! I opened #223

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NO_COLOR
2 participants