Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript errors from this library #382

Closed
CommanderRedYT opened this issue Apr 21, 2024 · 2 comments
Closed

Typescript errors from this library #382

CommanderRedYT opened this issue Apr 21, 2024 · 2 comments
Labels
needs response question Further information is requested

Comments

@CommanderRedYT
Copy link

I know this is not that much a thing about this library, but it is the only one causing me issues with typechecking.

I have a react native app using this library. When I run tsc --project tsconfig.json --pretty --noEmit --skipLibCheck, I get errors from only this library inside the node_modules folder.

$ tsc --project tsconfig.json --pretty --noEmit --skipLibCheck
node_modules/react-native-paper-dates/src/Date/Calendar.tsx:16:19 - error TS7016: Could not find a declaration file for module 'color'. '/home/user/bla/node_modules/color/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/color` if it exists or add a new declaration (.d.ts) file containing `declare module 'color';`

16 import Color from 'color'
                     ~~~~~~~

node_modules/react-native-paper-dates/src/Date/Swiper.tsx:106:13 - error TS2812: Property 'scrollTo' does not exist on type 'HTMLDivElement'. Try changing the 'lib' compiler option to include 'dom'.

106     element.scrollTo({
                ~~~~~~~~

I tried upgrading this library and/or typescript to their newest versions, but nothing worked... Even when I install the @types/color package, the error is still here...

@CommanderRedYT CommanderRedYT added the question Further information is requested label Apr 21, 2024
@iM-GeeKy
Copy link
Collaborator

iM-GeeKy commented May 6, 2024

Hi @CommanderRedYT, I'd recommend adding "exclude": ["node_modules"] to your tsconfig.json. It is recommended to exclude it anyways.

@iM-GeeKy iM-GeeKy closed this as completed May 6, 2024
@CommanderRedYT
Copy link
Author

Hi @iM-GeeKy , I already have that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs response question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants