You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to this comment, in order to compile TypeScript with Babel, you need the isolatedModules flag. However, this flag is incompatible with the declaration flag, which is used to avoid manually duplicated TypeScript type definitions for a library. We have been compiling redux-react-hook just fine without isolatedModules, but every time we run yarn test it is added back in and needs to be reverted. Is there a way for emitted declaration files to play nicely with create-react-app?
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.
I assume this isn't getting any traction because when you use babel to compile typescript, as create-react-app does, you are supposed to use isolatedModules, and isolatedModules is not compatible with declaration, per microsoft/TypeScript#29490.
lockbot
locked and limited conversation to collaborators
Apr 11, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
According to this comment, in order to compile TypeScript with Babel, you need the
isolatedModules
flag. However, this flag is incompatible with thedeclaration
flag, which is used to avoid manually duplicated TypeScript type definitions for a library. We have been compilingredux-react-hook
just fine withoutisolatedModules
, but every time we runyarn test
it is added back in and needs to be reverted. Is there a way for emitted declaration files to play nicely withcreate-react-app
?Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes
➜ yarn --version
1.12.3
Which terms did you search for in User Guide?
typescript, tsconfig, declaration, isolatedModules
Environment
➜ create-react-app --info
Environment Info:
System:
OS: macOS 10.14.1
CPU: x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
Binaries:
Node: 10.15.0 - ~/.nvm/versions/node/v10.15.0/bin/node
Yarn: 1.12.3 - ~/.yarn/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.15.0/bin/npm
Browsers:
Chrome: 72.0.3626.119
Safari: 12.0.1
npmPackages:
react: ^16.8.3 => 16.8.3
react-dom: ^16.8.3 => 16.8.3
react-scripts: ^2.1.3 => 2.1.3
npmGlobalPackages:
create-react-app: Not Found
Steps to Reproduce
yarn create react-app cra-tsconfig-bug --typescript
cd cra-tsconfig-bug
touch .watchmanconfig
tsconfig.json
, changeisolatedModules
todeclaration
yarn test
isolatedModules: true
is added back totsconfig.json
Expected Behavior
yarn test
should not be modifying mytsconfig.json
to put it in an invalid stateActual Behavior
yarn test
addsisolatedModules: true
, which is not compatible withdeclaration: true
for emitting declaration files.Reproducible Demo
See steps above, this is very easy to reproduce.
The text was updated successfully, but these errors were encountered: