Open mobinni opened 5 years ago
I realize that the ambiguity between babel building and how tsconfig does validation is not really a bug and that the above configuration will allow for a migration path
This sounds like a bug, maybe. Let's leave it open and get a better understanding. Thanks!
Has anyone found a solution or workaround for this problem yet ? For reasons specific to my current project, it is really bugging me right now.
I am also facing this issue. Any solution yet?
Migrating a code base from flow to ts and also facing this issue
Bumping this as it's been +2 years
I am getting the issue anyone got the solution??
I am upgrading to yarn 4 and I struggle with prisma that generate a client with js file that emit error and I want to ignore, checkJs false does not help
Is this a bug report?
Yes (sort of)
Did you try recovering your dependencies?
Not necessary
Which terms did you search for in User Guide?
Looked through documentation and issues, did not find relevant ticket or info.
Environment
(paste the output of the command here)
Steps to Reproduce
checkJs: false
to tsconfig.jsonExpected Behavior
I would like the
checkJs
to be taken into account when building the application to allow migration from a flow-based application to typescript while allowing JS to be built in but not having typescript validate it. This will also allow typescript to import JS components without validating their implicit types.Basically I have a codebase where I was using react-scripts-ts and we were able to slowly migrate using
allowJs: true
andcheckJs: false
and have eslint cover checking the code. I realize that having types in JS files is invalid syntax, however I'm in a migration process of removing flow.Actual Behavior
Currently
checkJs
option is ignored in the parenttsconfig.json
.Configuration that normally works for flow migration
In CRA 2 the following options work:
It will still compile properly with the issues and render the component, even the build will work, but this is counter-intuitive. Shouldn't allowJs false throw an error if JS is being imported on build?
Reproducible Demo
https://github.com/mobinni/cra-flow-migration
1) Run yarn start
Output:
I also noticed that typescript with checkJs to true will infer types based on the defaulted value in the component and complain if something else is passed in:
I've also tried using
// @ts-nocheck
/// @ts-ignore
however that does not seem to take effect