microsoft / microsoft/TypeScript
Weird error message for mixed exported/non-exported declarations under `isolatedModules`
オープン
まだ誰も着手していません。
Needs Proposal
Suggestion
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
// @isolatedModules: true
export function bar() {
}
interface bar {
}
export { bar as MyThing };
Expected: I actually don't know 😄. I think it should just work though.
Actual: Unclear error message
In nightlies (3.8+), the message is currently
Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
In 3.7.4 the message is still unclear.
Cannot re-export a type when the '--isolatedModules' flag is provided.
But bar is also a value!
See also
- https://github.com/microsoft/TypeScript/issues/32662 (which is about correcting the phrasing of the error)
- https://github.com/microsoft/TypeScript/issues/32601 (which is about I guess giving the user better suggestions)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、TypeScript compiler で isolatedModules の下にある提示された宣言と再エクスポートを再現し、その後、現在の診断を 3.7.4 およびそれ以降の nightlies について説明されている動作と比較します。関連する診断の文言と提案については issue #32662 と #32601 を確認します。混在した値/型宣言に明確で合意された診断、または有効な動作が与えられれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100