microsoft / microsoft/TypeScript
Auto-delete closing tag when opening tag becomes self-closed
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
When I type a paired tag, for example:
```tsx
```
If I then add a slash at the end of the opening tag to make it self-closing:
```tsx
```
The editor leaves the redundant closing tag untouched, resulting in broken/invalid markup.
https://github.com/user-attachments/assets/b4335989-09ba-423c-a79e-3f6a69c0275f
**Expected behavior:**
```tsx
```
https://github.com/user-attachments/assets/b9a5a910-5927-48ff-bbbd-0036d96e03c1
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 TSX example in the report by adding a slash to the opening tag, then trace the editor behavior responsible for paired-tag handling. Done means converting to without leaving the redundant closing tag; add or run a regression test if the relevant test location is found.
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
- 58/100