microsoft / microsoft/TypeScript
No error when exporting from global augmentations
オープン
Breaking Change
Bug
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
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.
```ts
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:
```ts
declare global {
var XYZ: number;
}
export { XYZ };
```
[Playground Link](https://www.typescriptlang.org/play/?#code/CYUwxgNghgTiAEBzCB7ARlC8DeAoeB8AbrPABoCaAWgFzwB2ArgLZogwDcuAvrriAA8ADihgAXHOWrxuHIA)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。