microsoft / microsoft/TypeScript

Paste with imports duplicates imports for namespace imports

オープン
#60,419 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

@navya9singh がすでに取り組んでいます。

2024年11月12日 から。

Needs Investigation
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

🔎 Search Terms
  • paste with imports
  • paste update imports
🕗 Version & Regression Information

5.7.0-dev.20241030

⏯ Playground Link

No response

💻 Code

consts.ts

export const a = 123;

console.log(a);

index.ts

import * as consts from "./consts";

console.log(consts.a);
  1. In consts.ts, copy console.log(a);
  2. Paste into index.ts
🙁 Actual behavior

Imports get duplicated:

import * as consts from "./consts";
import { a } from "./consts";

console.log(consts.a);
console.log(a);
🙂 Expected behavior

It should rewrite the code to use the existing import:

import * as consts from "./consts";

console.log(consts.a);
console.log(consts.a);
Additional information about the issue

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。