1

I have a mostly js project in which only the tests are written in typescript. However these tests (jest) show errors from node modules e.g.

 console.error
      Warning: Failed prop type: Invalid prop `in` of type `function` supplied to `ForwardRef(Fade)`, expected `boolean`.

How can I tell typescript to ignore all files except my test files?

Thanks

Nespony
  • 1,253
  • 4
  • 24
  • 42

1 Answers1

0

Question similar to How to force tsc to ignore node_modules folder?

You can try --skipLibCheck. But it's better to solve the type problem, usually it spots some problems (like duplicated versions)

A common case where you might think to use skipLibCheck is when there are two copies of a library’s types in your node_modules. In these cases, you should consider using a feature like yarn’s resolutions to ensure there is only one copy of that dependency in your tree or investigate how to ensure there is only one copy by understanding the dependency resolution to fix the issue without additional tooling.

maksimr
  • 4,891
  • 2
  • 23
  • 22