When running tsc on a react-native project, I'm getting a type error in one of the node_modules libraries:
node_modules/react-native-swiper-flatlist/src/components/SwiperFlatList/SwiperFlatList.tsx:79:17 - error TS7031: Binding element '_index' implicitly has an 'any' type.
79 ({ index: _index, prevIndex: _prevIndex }) => {
tsc shouldn't be checking node_modules, as it's explicetely ignored in the tsconfig.json:
{
"extends": "expo/tsconfig.base",
"include": ["src", "storybook", "types"],
"exclude": ["node_modules", "babel.config.js"],
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"incremental": true,
"isolatedModules": true,
"jsx": "react",
"lib": ["es6"],
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"strictNullChecks": true,
"target": "esnext",
"module": "esnext",
"baseUrl": ".",
"paths": {
"~*": ["./src/*"]
}
}
}
I saw a related post on ignoring node_modules, and it suggested adding "skipLibCheck": true to the tsconfig.json, but that didn't change anything.
I'm importing react-native-swiper-flatlist in one place the following way:
import { SwiperFlatList } from "react-native-swiper-flatlist";
Using typescript v4.7.3.
Any idea why tsc would be picking up this one specific file, and any suggestions on how to exclude it from being checked?