Skip to content

pretty option is ignored in terminal #1418

Closed
@elevatebart

Description

@elevatebart

Expected Behavior

When I specify pretty: false I expect the errors to respect that.
This is particularly useful if I am developing a tool that uses ts-node and I need to handle 3rd party potentially faulty code.

Actual Behavior

Because of this line, when I use a terminal as the main output for my tool, pretty is ignored:

ts-node/src/index.ts

Lines 628 to 630 in e8a4d76

const formatDiagnostics =
process.stdout.isTTY || options.pretty
? ts.formatDiagnosticsWithColorAndContext || ts.formatDiagnostics

Steps to reproduce the problem

Run ts-node on a faulty codebase with --pretty false option.
Errors are still styled with terminal only decoration.

Minimal reproduction

TypeStrong/ts-node-repros#16

Specifications

ts-node v8.3.0
node v14.17.0
compiler v4.3.5

tsconfig.json

{
  "compilerOptions":{
    "pretty": false
  }
}
  • Operating system and version: MacOS - Big Sur

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions