React-TypeScript-Webpack-Starter
React-TypeScript-Webpack-Starter copied to clipboard
Project builds successfully although type errors
Hello. Thank you for awesome tutorial and starter pack! But I found some problem. If I make a mistake with Typescript code, then build will be created successfully. Also "npm start" will be executed successfully too. For example:
import { useState } from 'react'
export const Counter = () => {
let a = 90
a += 'dfdfdf' //this is error!
const [count, setCount] = useState(0)
return (
<div>
<h3>Update {a} the count and edit src/App.tsx, state is preserved</h3>
<button onClick={() => setCount((c) => c + 1)}>Count - {count}</button>
</div>
)
}
It is possible to prevent building process or prevent starting app if Typescript errors exists ?
I think @gopinav wanted it a less strict way for starters. But you can do it in a couple of ways. You can tweak tsconfig.json
or Linting Rules.
But yeah Build shouldn't happen. I overlooked that!