Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent choice of quotes when using move to file #54376

Closed
gabritto opened this issue May 24, 2023 · 0 comments 路 Fixed by #54975
Closed

Inconsistent choice of quotes when using move to file #54376

gabritto opened this issue May 24, 2023 · 0 comments 路 Fixed by #54975
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@gabritto
Copy link
Member

Bug Report

馃攷 Search Terms

refactoring, move to file

馃捇 Code

source.ts:

import { b } from './other';
const a = 1;
const c = a + b;

target.ts:

export const tt = 2;

Select const c = a + b;, trigger move to file refactoring and select target.ts file.

馃檨 Actual behavior

target.ts:

import { a } from './source';

import { b } from "./other";

export const tt = 2;
const c = a + b;

馃檪 Expected behavior

The imports added should have the same quote style, maybe preferring the one from the source file when we can't detect a preference for the target file.

target.ts:

import { a } from './source';

import { b } from './other';

export const tt = 2;
const c = a + b;

or at least
target.ts:

import { a } from "./source";

import { b } from "./other";

export const tt = 2;
const c = a + b;

More examples in the test changes of #54358.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants