* Add code fix to convert 'require' in a '.ts' file to an 'import'
* Only add suggestion for modules
* Revert "Only add suggestion for modules"
This reverts commit b1a728fdac
.
15 lines
346 B
TypeScript
15 lines
346 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
// @Filename: /a.ts
|
|
////const a = [|require("a")|];
|
|
|
|
verify.getSuggestionDiagnostics([{
|
|
message: "'require' call may be converted to an import.",
|
|
code: 80005,
|
|
}]);
|
|
|
|
verify.codeFix({
|
|
description: "Convert 'require' to 'import'",
|
|
newFileContent:
|
|
`import a = require("a");`,
|
|
});
|