2018-03-01 23:41:55 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// @allowJs: true
|
|
|
|
// @checkJs: true
|
|
|
|
|
|
|
|
// @Filename: /node_modules/abs/index.js
|
|
|
|
////export default function abs() {}
|
|
|
|
|
|
|
|
// @Filename: /a.js
|
|
|
|
////import abs from [|"abs"|];
|
2018-04-05 21:33:00 +02:00
|
|
|
////abs;
|
2018-03-01 23:41:55 +01:00
|
|
|
|
|
|
|
test.setTypesRegistry({ "abs": undefined });
|
|
|
|
|
|
|
|
verify.noErrors();
|
|
|
|
goTo.file("/a.js");
|
|
|
|
verify.getSuggestionDiagnostics([{
|
|
|
|
message: "Could not find a declaration file for module 'abs'. '/node_modules/abs/index.js' implicitly has an 'any' type.",
|
|
|
|
code: 7016,
|
|
|
|
}]);
|
|
|
|
|
|
|
|
verify.codeFixAvailable([
|
|
|
|
{
|
|
|
|
description: "Install '@types/abs'",
|
|
|
|
commands: [{
|
|
|
|
type: "install package",
|
|
|
|
file: "/a.js",
|
|
|
|
packageName: "@types/abs",
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
{ description: "Ignore this error message" },
|
|
|
|
{ description: "Disable checking for this file" },
|
|
|
|
]);
|