React-TypeScript-Webpack-Starter icon indicating copy to clipboard operation
React-TypeScript-Webpack-Starter copied to clipboard

Project builds successfully although type errors

Open seleznevds opened this issue 2 years ago • 1 comments

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 ?

seleznevds avatar Mar 22 '22 17:03 seleznevds

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!

HeyProtagonist avatar Jun 20 '22 05:06 HeyProtagonist