Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React Native: Build does not fail on TypeScript error

$
0
0

How can I make the React Native CLI fail on a TypeScript error?

    const getCatOfTheDay = (cat: string) => `Cat of the day: ${cat}`;    getCatOfTheDay(123);

This should throw a TypeScript error

Argument of type 'number' is not assignable to parameter of type 'string'.ts(2345)

but instead my npm start does just continue working and doesn't throw any error.

My tsconfig.json

{"compilerOptions": {"allowSyntheticDefaultImports": true,"forceConsistentCasingInFileNames": true,"jsx": "react-native","module": "commonjs","noEmit": true,"noEmitOnError": true,"strict": true,"target": "ES2020"    }}

Using react-native 0.62


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>