I'm using CRA with TypeScript and followed the docs to integrate typescript.
My problem is that npm run build does not fail when there is a TypeScript error in the tests. I noticed that the webpack.config.js ignores errors in test files. See the reportFiles array. It would be awesome to report TypeScript errors in test files too so that a team can know if a change caused a TypeScript error in a test.
Alternatively, npm test should report TypeScript errors.
Note too in the react-scripts-ts fork this was supported so those of us migrating to CRA from there would expect this.
This looks like a dupe of https://github.com/facebook/create-react-app/issues/5626
Our current workaround is to run tsc as a CI build step. This will report type errors in test files.
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.
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.
Closing as dupe of #5626.
Most helpful comment
This looks like a dupe of https://github.com/facebook/create-react-app/issues/5626
Our current workaround is to run
tscas a CI build step. This will report type errors in test files.