microsoft / microsoft/TypeScript

Auto-delete closing tag when opening tag becomes self-closed

Open
#64,144 3 comments 0 reactions 0 assignees View on GitHub
Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
PR merge metrics
PR metrics pending

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

Open the contributing guide

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.