2018-05-18 01:19:50 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
//@allowJs: true
|
|
|
|
|
|
|
|
// @Filename: /mymodule.js
|
2018-05-22 16:56:29 +02:00
|
|
|
////(function ([|root|], factory) {
|
|
|
|
//// module.exports = factory();
|
|
|
|
////}(this, function () {
|
|
|
|
//// var [|unusedVar|] = "something";
|
|
|
|
//// return {};
|
2018-05-18 01:19:50 +02:00
|
|
|
////}));
|
|
|
|
|
|
|
|
// @Filename: /app.js
|
2018-05-22 16:56:29 +02:00
|
|
|
//////@ts-check
|
2018-05-18 01:19:50 +02:00
|
|
|
////require("./mymodule");
|
|
|
|
|
|
|
|
const [range0, range1] = test.ranges();
|
|
|
|
|
|
|
|
goTo.file("/app.js");
|
|
|
|
verify.getSuggestionDiagnostics([]);
|
|
|
|
|
|
|
|
goTo.file("/mymodule.js");
|
2018-05-22 16:56:29 +02:00
|
|
|
verify.getSuggestionDiagnostics([
|
|
|
|
{
|
|
|
|
message: "'root' is declared but its value is never read.",
|
|
|
|
code: 6133,
|
|
|
|
range: range0,
|
|
|
|
reportsUnnecessary: true,
|
|
|
|
},
|
|
|
|
{
|
2018-05-18 01:19:50 +02:00
|
|
|
message: "'unusedVar' is declared but its value is never read.",
|
|
|
|
code: 6133,
|
2018-05-22 16:56:29 +02:00
|
|
|
range: range1,
|
|
|
|
reportsUnnecessary: true,
|
|
|
|
},
|
|
|
|
]);
|