Skip to content

CRA does not check for presence of emitDeclarationOnly in tsconfig #9373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
squidsoup opened this issue Jul 27, 2020 · 2 comments
Closed

CRA does not check for presence of emitDeclarationOnly in tsconfig #9373

squidsoup opened this issue Jul 27, 2020 · 2 comments

Comments

@squidsoup
Copy link

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

  1. Set emitDeclarationOnly: true in .tsconfig.
  2. Run a yarn script that uses react-scripts e.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

@stale
Copy link

stale bot commented Aug 29, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Aug 29, 2020
@stale
Copy link

stale bot commented Sep 5, 2020

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant