question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tsc CLI: option to always exit with 0 exit code

See original GitHub issue

It would be nice if the tsc command had an option to always exit with a 0 exit code when there were compile errors. I want to run something in my script after compiling. Currently I have to do this:

set -e
# script stuff
set +e
tsc …
set -e

However this workaround means all errors from tsc will be silently ignored, not just compile errors.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:11
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
BrandiATMuhkuhcommented, Apr 24, 2018

currently I solve the issue with tsc || exit 0

2reactions
ProdigySimcommented, Jul 12, 2022

Here’s my use case for this feature:

I have a project that is gradually adopting TS and does not have 100% strict compliance yet. So, almost every time we run tsc we expect some errors.

However, sometimes code gets checked in that breaks tsc completely (Call Stack size exceeded, OOM, etc.). I would like to build a CICD job that will ensure that tsc --noEmit will run without encountering a Fatal Error. This is difficult to do if TSC always exits with an error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - tsc CLI Options
Flag Type Default ‑‑allowJs boolean false ‑‑allowUmdGlobalAccess boolean false ‑‑allowUnreachableCode boolean
Read more >
Keep getting "tsc.exe" exited with code 1
As i was facing same issue and after installing Typescript again got resolved the error, as tsc.exe was missing in (C:\Program Files (x86)\ ......
Read more >
ts-node-dev
Compiles your TS app and restarts when files are modified.. Latest version: 2.0.0, last published: 7 months ago. Start using ts-node-dev in ...
Read more >
Tasks in Visual Studio Code
Select tsc: build or tsc: watch and VS Code will generate a tasks.json file. ... always revealed and a new terminal is created...
Read more >
Yarn run error command failed with exit code 1
Nov 04, 2021 · It would be like the C# compiler returning exit code 0 for code ... If the --check-cache option is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found