microsoft / microsoft/TypeScript
Respect trailing comma style when organizing imports
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
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
}
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by locating the TypeScript organize imports entry point and reviewing how its formatting options are configured, then compare the behavior with ESLint's comma-dangle rule. Done means trailing commas can be enabled for multiline imports without breaking existing organize-imports behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- eslint, typescript
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100