microsoft / microsoft/TypeScript
Make JS/TS Import fix insert import in linter specified order
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
Popular linting rules in the TypeScript community require imports to be in alphabetic order (see ordered-imports in tslint:recommended). This is generally useful for readability of imports.
In VS Code, when a developer references an external module that hasn't been imported, VS Code offers a useful fix, which adds the appropriate import:

This is extremely useful! Thanks you! 🎉
However, once automatically imported, the import is just added to the end of the import list, leading to a linter error (since it's not in alphabetic order)😕:

You can then auto-fix the import issue (VS Code is aware of the TSLint preferences):

Would it be possible to short-circuit these steps such that when a developer "fixes" a missing import, it automatically inserts it in the appropriate order based on linting rules? FWIW, this also applies to the JS community (eslint has import order rules as well).
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
この Issue では、VS Code の不足している import の自動修正と、TypeScript および ESLint または TSLint の import-order ルールとの相互作用について説明していますが、ソースファイルやテストは指定されていません。まず、自動 import のコードパスと、既存の import 順序の処理を特定してください。JavaScript と TypeScript で、新しく挿入された import が適用可能な設定済みの順序に従えば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- developer-experience, tooling
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100