We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f20a330 commit 5444f3cCopy full SHA for 5444f3c
src/services/codefixes/importFixes.ts
@@ -500,6 +500,15 @@ namespace ts.codefix {
500
}
501
502
relativeFileName = removeFileExtension(relativeFileName);
503
+
504
+ if (startsWith(relativeFileName, "@types/")) {
505
+ relativeFileName = relativeFileName.substr(/*"@types".length*/ 7);
506
+ if (relativeFileName.indexOf("__") !== -1) {
507
+ // Double underscores are used in DefinitelyTyped to delimit scoped packages.
508
+ relativeFileName = "@" + relativeFileName.replace("__", "/");
509
+ }
510
511
512
if (endsWith(relativeFileName, "/index")) {
513
relativeFileName = getDirectoryPath(relativeFileName);
514
0 commit comments