I ran into an issue where types I had downloaded using NPM weren’t being automatically picked up by my IDE (PHPStorm). This caused the IDE to believe there were errors in these files even though they would compile fine.
If you have your IDE setup to read from the tsconfig.json file of your project you can easily resolve this by ensuring your @types are imported within the include directive of your configuration.
To include all @types automatically you could write the following into your include section:
The IDE shall automatically then include the type definitions, so no more errors!