Skip to content

Commit

Permalink
fix: allow to specify pretty errors in TTY
Browse files Browse the repository at this point in the history
  • Loading branch information
elevatebart committed Aug 5, 2021
1 parent e8a4d76 commit 88fb2b2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/index.ts
Expand Up @@ -625,8 +625,13 @@ export function create(rawOptions: CreateOptions = {}): Service {
},
});

const formatDiagnostics =
process.stdout.isTTY || options.pretty
const shouldHavePrettyErrors =
options.pretty === undefined
? process.stdout.isTTY
: options.pretty

const formatDiagnostics =
shouldHavePrettyErrors
? ts.formatDiagnosticsWithColorAndContext || ts.formatDiagnostics
: ts.formatDiagnostics;

Expand Down

0 comments on commit 88fb2b2

Please sign in to comment.