No error when exporting from global augmentations

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

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

2026年9月4日 から。

  • #64162 @copilot-swe-agent による — オープン

評価

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

説明

Breaking Change Bug

If you export a binding from the global scope, you're supposed to get an error unless you create a local binding and export it with whatever name you want.

export { Math };
//       ~~~~
// Cannot export 'Math'. Only local declarations can be exported from a module.

However, we have a hole and allow exports that originate from a global augmentation. The following file is permitted with no error:

declare global {
    var XYZ: number;
}

export { XYZ };

Playground Link

主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 15時間
マージ済み PR(30日)
106

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

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

はじめの一歩

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

microsoft/TypeScript のほかの issue

microsoft/TypeScript の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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