microsoft / microsoft/TypeScript
Respect trailing comma style when organizing imports
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
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
}
}
}
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Es ist weder eine Quelldatei noch ein Test angegeben. Beginne damit, den TypeScript organize imports-Einstiegspunkt zu finden und zu prüfen, wie dessen Formatierungsoptionen konfiguriert werden, und vergleiche anschließend das Verhalten mit der ESLint-Regel comma-dangle. Erledigt ist die Aufgabe, wenn sich nachgestellte Kommas für mehrzeilige Imports aktivieren lassen, ohne das bestehende organize-imports-Verhalten zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- eslint, typescript
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100