2018-01-09 22:15:47 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// @allowJs: true
|
2018-04-24 01:05:37 +02:00
|
|
|
// @target: esnext
|
2018-01-09 22:15:47 +01:00
|
|
|
|
|
|
|
// @Filename: /a.js
|
2018-04-17 01:46:27 +02:00
|
|
|
////[|exports.f|] = function() {};
|
2018-03-01 16:34:51 +01:00
|
|
|
////exports.C = class {};
|
2018-01-09 22:15:47 +01:00
|
|
|
////exports.x = 0;
|
2018-04-16 22:16:04 +02:00
|
|
|
////exports.a1 = () => {};
|
|
|
|
////exports.a2 = () => 0;
|
|
|
|
////exports.a3 = x => { x; };
|
|
|
|
////exports.a4 = x => x;
|
2018-01-09 22:15:47 +01:00
|
|
|
|
2018-10-12 01:15:38 +02:00
|
|
|
const [r0, r1, r2] = test.ranges();
|
|
|
|
verify.getSuggestionDiagnostics([
|
|
|
|
{ message: "File is a CommonJS module; it may be converted to an ES6 module.", code: 80001, range: r0 },
|
|
|
|
]);
|
2018-02-28 20:16:32 +01:00
|
|
|
|
|
|
|
verify.codeFix({
|
|
|
|
description: "Convert to ES6 module",
|
|
|
|
newFileContent:
|
2018-04-16 22:16:04 +02:00
|
|
|
`export function f() {}
|
2018-05-30 23:12:38 +02:00
|
|
|
export class C {}
|
2018-04-16 22:16:04 +02:00
|
|
|
export const x = 0;
|
|
|
|
export function a1() {}
|
|
|
|
export function a2() { return 0; }
|
|
|
|
export function a3(x) { x; }
|
|
|
|
export function a4(x) { return x; }`,
|
2018-01-09 22:15:47 +01:00
|
|
|
});
|