microsoft / microsoft/TypeScript
ts1484 Quick fix will dupe comments
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
### 🔎 Search Terms
"quickfix comment" "dupe comment"
### 🕗 Version & Regression Information
- This changed between versions 6.0.0-dev.20260416 and 6.0.3 of vscode extensions.
### ⏯ Playground Link
_No response_
### 💻 Code
index.ts:
```ts
// upper comment
/*left comment*/ import { foo } from "./foo"; // right comment
// lower comment
```
foo.ts:
```ts
export type foo = "foo":
```
and enable verbatimModuleSyntax.
then run quick fix `use 'import type'`.
### 🙁 Actual behavior
index.ts:
```ts
// upper comment
/*left comment*/ // upper comment
/*left comment*/ import type { foo } from "./foo"; // right comment
// right comment
// lower comment
```
upper, left and right comment is duped.
### 🙂 Expected behavior
```ts
// upper comment
/*left comment*/ import type { foo } from "./foo"; // right comment
// lower comment
```
### Additional information about the issue
ts1484 error: 'foo' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
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
Reproduce the issue with the index.ts and foo.ts snippets, enable verbatimModuleSyntax, and invoke the ts1484 quick fix to use an import type. Start by tracing the quick-fix behavior for that diagnostic; done means the import changes without duplicating the upper, left, or right comments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100