We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c1c9ce commit b044e71Copy full SHA for b044e71
src/index.ts
@@ -675,10 +675,12 @@ export function create(rawOptions: CreateOptions = {}): Service {
675
},
676
});
677
678
- const formatDiagnostics =
679
- process.stdout.isTTY || options.pretty
680
- ? ts.formatDiagnosticsWithColorAndContext || ts.formatDiagnostics
681
- : ts.formatDiagnostics;
+ const shouldHavePrettyErrors =
+ options.pretty === undefined ? process.stdout.isTTY : options.pretty;
+
+ const formatDiagnostics = shouldHavePrettyErrors
682
+ ? ts.formatDiagnosticsWithColorAndContext || ts.formatDiagnostics
683
+ : ts.formatDiagnostics;
684
685
function createTSError(diagnostics: ReadonlyArray<_ts.Diagnostic>) {
686
const diagnosticText = formatDiagnostics(diagnostics, diagnosticHost);
0 commit comments