* Add 'move to new file' refactor * Code review, and support commonjs * Compute movedSymbols completely before using, and support `export import` * Fix assertion error: sort empty change before non-empty change * Remove extra newline * Add allowTextChangesInNewFiles preference * Add the new file to 'files' in tsconfig * Avoid parameter initializer * Update API baselines * Use path relative to tsconfig.json * Code review * Fix error where node in tsconfig file was missing a source file
35 lines
618 B
TypeScript
35 lines
618 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
// @allowJs: true
|
|
|
|
// @Filename: /a.js
|
|
////const { a, b } = require("./other");
|
|
////const p = 0;
|
|
////[|const y = p + b;
|
|
////const z = 0;
|
|
////exports.z = 0;|]
|
|
////a; y; z;
|
|
|
|
// @Filename: /user.ts
|
|
////const { x, y } = require("./a");
|
|
|
|
verify.moveToNewFile({
|
|
newFileContents: {
|
|
"/a.js":
|
|
// TODO: GH#22330
|
|
`const { y, z } = require("./y");
|
|
|
|
const { a, } = require("./other");
|
|
const p = 0;
|
|
exports.p = p;
|
|
a; y; z;`,
|
|
|
|
"/y.js":
|
|
`const { b } = require("./other");
|
|
const { p } = require("./a");
|
|
const y = p + b;
|
|
exports.y = y;
|
|
const z = 0;
|
|
exports.z = 0;`,
|
|
},
|
|
});
|