Reputation: 4811
I'm a huge fan of static type, but there are many JS libraries that either don't have type definitions or have type definitions that are out of date and therefore cause compiler errors when you try to use a newer function.
Are there any known workarounds / practices in the TS community for overcoming this hurdle?
Upvotes: 4
Views: 1934
Reputation: 12018
In the event of missing, incomplete, or broken types, IMO the best thing you can do is make a pull request to DefinitelyTyped.
In the meantime, here are some ways of solving issues locally:
(lib as any).someMissingMethod()
, or put a // @ts-ignore: explanation here
comment above the line that errors, to temporarily suppress the error.Upvotes: 4