This fixes errors discovered by yarn run tsc -- --noEmit (the last arg to skip outputting compiled files we don't care about) and adds that check to CI to keep the project clean. I was wondering why a type error in another change of mine wasn't caught, and this was the reason. In particular the export default from error in the async-storage.js mock seemed like a parse error that stopped it from discovering any other issues.
Use the official/compiled import entrypoints for react-native-paper and not their raw source code (eg avoid everything in the src/ directory) which in turn means we're no longer incorrectly type checking their code.
Remove the <ViewStyle> explicit types from StyleSheet.compose since it was complaining about not enough type arguments, but can infer the types just fine and matches the examples at https://reactnative.dev/docs/stylesheet#compose.
This fixes errors discovered by
yarn run tsc -- --noEmit
(the last arg to skip outputting compiled files we don't care about) and adds that check to CI to keep the project clean. I was wondering why a type error in another change of mine wasn't caught, and this was the reason. In particular theexport default from
error in theasync-storage.js
mock seemed like a parse error that stopped it from discovering any other issues.The fixes fall into a few categories:
react-native-paper
and not their raw source code (eg avoid everything in thesrc/
directory) which in turn means we're no longer incorrectly type checking their code.<ViewStyle>
explicit types fromStyleSheet.compose
since it was complaining about not enough type arguments, but can infer the types just fine and matches the examples at https://reactnative.dev/docs/stylesheet#compose.setTimeout
(it maybe seems to think it's using Node types there? I dunno this fix was recommended by https://stackoverflow.com/questions/45802988/typescript-use-correct-version-of-settimeout-node-vs-window).