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-02-28 20:16:32 +01:00
|
|
|
////const x = require("x").default;
|
2018-01-09 22:15:47 +01:00
|
|
|
////const a = require("b").c;
|
|
|
|
////const a = require("a").a;
|
|
|
|
////const [a, b] = require("c").d;
|
|
|
|
////const [a, b] = require("c").a; // Test that we avoid shadowing the earlier local variable 'a' from 'const [a,b] = d;'.
|
2018-04-05 21:33:00 +02:00
|
|
|
////x; a; b;
|
2018-01-09 22:15:47 +01:00
|
|
|
|
2018-02-28 20:16:32 +01:00
|
|
|
verify.codeFix({
|
|
|
|
description: "Convert to ES6 module",
|
|
|
|
newFileContent:
|
|
|
|
`import x from "x";
|
2018-01-09 22:15:47 +01:00
|
|
|
import { c as a } from "b";
|
|
|
|
import { a } from "a";
|
|
|
|
import { d } from "c";
|
|
|
|
const [a, b] = d;
|
|
|
|
import { a as _a } from "c";
|
2018-04-05 21:33:00 +02:00
|
|
|
const [a, b] = _a; // Test that we avoid shadowing the earlier local variable 'a' from 'const [a,b] = d;'.
|
|
|
|
x; a; b;`,
|
2018-01-09 22:15:47 +01:00
|
|
|
});
|