microsoft / microsoft/TypeScript

Unwanted auto-imports in script files

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

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

2023年8月3日 から。

Effort: Moderate Experience Enhancement Help Wanted Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

Bug Report

I have a mixture of module and non-module code.
The problem occurs when I edit non-module files (tsconfig: "module": "none").

Sometimes when using auto-completion (in VisualStudio 2022) typescript finds a "matching" name from the module world and adds a line like

import { HmiHelper } from './helper/HmiHelper.js';

into the first line of my file.
But as the current file was configured as "module": "none" this import pushes typescript into modules mode and the current code is invalid.

🔎 Search Terms

intellisense
auto-import
modules

🕗 Version & Regression Information

This bug is many years old and persists in Typescript 5.1.

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

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

はじめの一歩

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

評価

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

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

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