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.

Control TSC's noEmit or emitDeclarationOnly when using composite projects

See original GitHub issue

create-react-app doesn’t work in composite typescript projects, because for composite projects emitDeclarationOnly must be used instead of noEmit (when using noEmit: true and composite: true typescript compiler throws an error). I suggest to add a check - if typescript project is composite-based, use emitDeclarationOnly flag instead of noEmit.

See https://github.com/microsoft/TypeScript/issues/36917 for more information.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:16
  • Comments:7

github_iconTop GitHub Comments

19reactions
MichaelFroeschencommented, Aug 31, 2020

This is still a thing… I’m kinda getting annoyed by the fact, that some options are forced in such a way, without any explanation…

7reactions
sliktscommented, Mar 4, 2020

Options for incremental builds can look like this:

    "incremental": true,
    "emitDeclarationOnly": true,
    "outDir": ".cache/tsbuild",
    "skipLibCheck": true

Adding support for the incremental option was previously proposed in #6785, but was closed due to the webpack plugin already using incremental builds, but I think that misses the point; it’s also useful to check types with tsc without building, since it’s faster and allows to type check files that aren’t open in an editor.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Option 'noEmit' cannot be specified with option 'incremental'
So you should either remove noEmit: true or change it to emitDeclarationOnly: true . You can control the output folders using outDir and ......
Read more >
Documentation - tsc CLI Options - TypeScript
Flag Type Default ‑‑allowJs boolean false ‑‑allowUmdGlobalAccess boolean false ‑‑allowUnreachableCode boolean
Read more >
Understanding TypeScript Configuration Options
composite - tsBuildInfoFile - removeComments - noEmit - importHelpers ... By using it, you can structure your TypeScript project into smaller pieces.
Read more >
Kent C. Dodds on Twitter: "Ok, here's the best I got at the ...
I have a project with a client and server directory. ... Tried the "Project References" feature but I don't think that works with...
Read more >
TypeScript rules for Bazel - GitHub Pages
This can be used for a build with --noEmit , so that TypeScript is purely ... ts_project simply runs tsc --project , with...
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