TypeScript checks the entire codebase for transfer, even if only one file has really changed. For small projects, this is great, but since our code base has grown, it takes quite a while.
During development, I want a quick response time for my unit tests. unit test should start as soon as possible.
Unfortunately, I have to wait about 10-15 seconds on each run until the unit test starts, since tsc will take a long time to shut down, and from this time 60% -80% is spent on checking.
These examples run only from deleting and adding a line in a single file:
yarn tsc v0.27.5 $ "/home/philipp/fancyProject/node_modules/.bin/tsc" "--watch" "--diagnostics" Files: 511 Lines: 260611 Nodes: 898141 Identifiers: 323004 Symbols: 863060 Types: 302553 Memory used: 704680K I/O read: 0.17s I/O write: 0.09s Parse time: 2.61s Bind time: 0.95s Check time: 7.65s Emit time: 1.45s Total time: 12.65s 00:35:34 - Compilation complete. Watching for file changes. 00:41:58 - File change detected. Starting incremental compilation... Files: 511 Lines: 260612 Nodes: 898141 Identifiers: 323004 Symbols: 863060 Types: 302553 Memory used: 1085950K I/O read: 0.00s I/O write: 0.04s Parse time: 0.68s Bind time: 0.00s Check time: 12.65s Emit time: 1.36s Total time: 14.69s 00:42:13 - Compilation complete. Watching for file changes. 00:42:17 - File change detected. Starting incremental compilation... Files: 511 Lines: 260611 Nodes: 898141 Identifiers: 323004 Symbols: 863060 Types: 302553 Memory used: 1106446K I/O read: 0.00s I/O write: 0.12s Parse time: 0.32s Bind time: 0.01s Check time: 9.28s Emit time: 0.89s Total time: 10.50s 00:42:27 - Compilation complete. Watching for file changes.
I wonder if there is a way to say typescript:
Just consider everything as OK and just flush JavaScript as quickly as possible to disk.
I want to first make sure my unit test pass in order to have a fast feedback loop.
And since my IDE takes care of type checks already in the file I'm working on now, I rarely make mistakes in checking forwardings anyway. And if there was a big problem, my unit tests should catch them.
When creating a project, I would just use the classic tsc with checks. As I said, this is only for development and a quick feedback loop.
source share