microsoft / microsoft/TypeScript

TypeScript refactoring: option to use `export default` with "Move to a new file"

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

まだ誰も着手していません。

Awaiting More Feedback Suggestion
主要言語
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.

  1. "Move to a new file as default export"
  2. "Move to a new file as named export"

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

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

はじめの一歩

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

調査の方向性

リンクされている TypeScript のリファクタリングドキュメントを読み、issue で説明されている「Move to a new file」リファクタリングから始めてください。このリファクタリング中にユーザーがどちらの export スタイルでも選択できることを完了条件として、default-export と named-export の明示的な選択肢を提供する範囲を定義してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript, vscode
領域
developer-experience
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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