Reputation: 266
Can not import type declaration files. Consider importing "googlemaps" instead of "@ types / googlemaps".
I have the default options but this does not work for me.
Upvotes: 4
Views: 1036
Reputation: 1323553
In addition of not being related to the linter, as commented, issue 16472 adds:
In the vast majority of cases, an import from a module specifier beginning with
@types
is a bug and will result in a runtime error.
See for instance tinganho/express-request-language PR 13:
With the newer version of TypeScript => 2.4.1 there is the pointed error.
Importing types directly is an error, instead packages from which types are used should be imported.
-import * as e from '@types/express';
+import * as e from 'express';
See also "Deprecation Notice: Regarding [email protected]".
Upvotes: 3