How to ignore typescript errors in imported module

Viewed 163

My project build is choking on a typescript error that's internal to an imported module. How do I tell typescript to ignore it?

Obviously, I want typescript to help me with my own code, not punish me for type errors inside a third-party import.

In my tsconfig.json I've got

{
  "compilerOptions": {
    "skipLibCheck": true,
    ...
  },
  "exclude": ["node_modules"],
  ...
}

But I'm still getting

./node_modules/@[vendor]/[module]/src/components/ChatWidget.tsx:63:58
Type error: Type 'StaticImageData' is not assignable to type 'string'.

  61 |         <MessageCount count={props.unreadCount || unreadCount} isOpen={isOpen} />
  62 |         {isOpen ? (
> 63 |           <img className={'rschat-launcher__icon--open'} src={launcherIconActive} alt={'open chat window'} />
     |                                                          ^
  64 |         ) : (
  65 |           <img className={'rschat-launcher__icon--closed'} src={launcherIcon} alt={'close chat window'} />
  66 |         )}

The project is nextjs. Storybook builds using this module without complaint.

0 Answers
Related