microsoft / microsoft/TypeScript

Respect trailing comma style when organizing imports

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

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

Awaiting More Feedback Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

I use eslint with a typescript react project, and the comma-dangle rule is in direct conflict with the VS Code built in organize imports feature. Currently the organize imports feature supports multiple import variables on their own line, but will remove the trailing comma, causing the eslint rule to complain. Even if I manually fix it, the organize import feature will just remove it again.

PLEASE add the option to ALLOW trailing commas.

import {
    foo,
    bar,
    bloop,
} from "some-package";

That is perfectly valid Typescript and should be configurable.

Example of the setting in question:

"settings": {
	"editor.formatOnSave": true,
	"[typescript]": {
		"editor.codeActionsOnSave": {
			"source.organizeImports": true
		}
	}
}

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

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

はじめの一歩

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

調査の方向性

ソースファイルもテストも指定されていません。まず TypeScript organize imports のエントリポイントを特定し、そのフォーマットオプションがどのように設定されているかを確認してから、ESLint の comma-dangle ルールと動作を比較します。完了条件は、既存の organize-imports の動作を壊さずに、複数行の import で trailing commas を有効にできることです。

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

評価

技術スタック
eslint, typescript
領域
developer-experience, tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

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

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