I have a React 17 / Typescript 4.5 project. package.json looks like this:
...
"scripts": {
"start": "react-scripts start",
"build": "yarn run tsc --build"
}
My code has some Typescript errors that don't cause issues at runtime. When I run react-scripts start, the code builds and runs successfully in the browser, and React turns the errors into warnings that show up on initial page load. Conversely, when I run yarn run tsc --build, I can't compile the project due to the errors.
Yes, of course I should fix the errors, and I will. But while my code is rapidly evolving, solving certain tricky Typescript problems is premature. It may be useful to compile the code and temporarily ignore the errors.
I realize I can turn off specific errors in tsconfig.json, but I'd like to temporarily ignore all errors (at least, ones where Javascript can still be emitted).
Basically, what I want is a tsc flag that turns errors into warnings, but according to this related question, that doesn't exist. So how does react-scripts manage this? How can I compile my project in spite of the errors?