shubhanus / otp-input-react

React simple otp input with react hooks
MIT License
59 stars 85 forks source link

Could not find a declaration file for module #69

Open mursaleen-zenkoders opened 1 month ago

mursaleen-zenkoders commented 1 month ago

I installed this packet from npm i otp-input-react and pnpm i otp-input-react but it's throwing error that could not find a declaration file for module

I am using Next.js 14 with type script

issue

gusparis commented 1 month ago

@mursaleen-zenkoders add // @ts-ignore above line. If linter shows you an error, you will need to add the following to your eslint file:

module.exports = {
  // other configurations
  rules: {
    '@typescript-eslint/ban-ts-comment': [
      'error',
      {
        'ts-ignore': 'allow-with-description', // or 'ban-ts-ignore' to completely ban it
      },
    ],
  },
};

And then add the comment like // @ts-ignore Official @types/otp-input-react not available