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

No Typescript definition file. #9

Open
fullStackDataSolutions opened this issue Feb 4, 2020 · 2 comments
Open

No Typescript definition file. #9

fullStackDataSolutions opened this issue Feb 4, 2020 · 2 comments

Comments

@fullStackDataSolutions
Copy link

I'm converting my project to Typescript and am using check-prop-types all over the place in my testing.

I get this message:

Could not find a declaration file for module 'check-prop-types'. '/node_modules/check-prop-types/index.js' implicitly has an 'any' type.
Try npm install @types/check-prop-types if it exists or add a new declaration (.d.ts) file containing declare module 'check-prop-types';

Would it be possible to make a definition file?

@frank505
Copy link

having exactly the same issue right now any solution yet?

@qpitlove
Copy link

You can temporarily save the file below under the types folder and use it.

// check-type-props.d.ts

declare module "check-prop-types" {
    export const checkPropTypes: (typeSpecs: any,
        values: any,
        location: string,
        componentName: string) => string | undefined;
    export const assertPropTypes: (typeSpecs: any,
        values: any,
        location: string,
        componentName: string) => Error | undefined;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants