microsoft / microsoft/TypeScript
TypeScript refactoring: option to use `export default` with "Move to a new file"
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Among other reasons, I'd like to avoid barrel files and I find that default exports make doing so more intuitive (named exports are easily spread into a barrel file while default exports not so much).
Some files like default exports and some folks do not. I get that.
Unless there's a need to do so, I'd like VSCode to make it just as easy to use default exports as named exports. Today, TypeScript refactoring with Visual Studio Code favors named exports. This default behavior may provide some encouragement/bias to use them and not use default exports as much.
There is also a "Convert between default export and named export" refactoring which is handy but requires another step and an aware/intentional decision to use default exports.
Can "Move to a new file" be split into two options or otherwise support prompting developers to explicitly select which type of export to use while they are refactoring?
e.g.
- "Move to a new file as default export"
- "Move to a new file as named export"
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされている TypeScript のリファクタリングドキュメントを読み、issue で説明されている「Move to a new file」リファクタリングから始めてください。このリファクタリング中にユーザーがどちらの export スタイルでも選択できることを完了条件として、default-export と named-export の明示的な選択肢を提供する範囲を定義してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript, vscode
- 領域
- developer-experience
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100