CRA does not check for presence of emitDeclarationOnly in tsconfig
Created by: squidsoup
Describe the bug
I maintain a react component library, written in TypeScript. Our components use sass, and consequently we build the library using babel rather than tsc, and use tsc for generating type declarations with emitDeclarationOnly: true.
We do want to continue using CRA, however every time we touch react-scripts it adds noEmit: true to our .tsconfig which is incompatible with emitDeclarationOnly. Please note that these two keywords are incompatible with each other, settings noEmit: false is not a solution, and this is overwritten by react-scripts to true at any rate.
This makes CRA largely unusable for maintaining a TypeScript component library unfortunately.
Originally posted as a discussion.
Did you try recovering your dependencies?
n/a
Which terms did you search for in User Guide?
n/a
Environment
n/a
Steps to reproduce
- Set
emitDeclarationOnly: truein.tsconfig. - Run a yarn script that uses
react-scriptse.g.yarn test
Expected behavior
noEmit should not be added if emitDeclarationOnly is present.
Actual behavior
noEmit: true is added to .tsconfig, breaking the build.
Reproducible demo
n/a