Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>remove-empty-attributeNew to Visual Studio Code? Get it now.
remove-empty-attribute

remove-empty-attribute

Luca Park

| (0) | Free
Remove empty HTML-like attributes from the active editor.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Remove Empty Attribute

한국어 README

remove-empty-attribute is a VS Code extension that removes empty HTML-like attributes from the active editor.

It is designed for files that contain HTML tags, such as:

  • HTML
  • React JSX
  • React TSX
  • JSP

Features

  • Removes empty quoted attributes such as name="" and id=''
  • Removes empty JSX-style string expressions such as name={""} and id={''}
  • Keeps non-empty attributes unchanged

Example

Before:

<input type="text" name="" id="" placeholder="Task" />
<input type="date" name={""} id={''} />

After:

<input type="text" placeholder="Task" />
<input type="date" />

Usage

  1. Open a file that contains HTML-like tags.
  2. Open the Command Palette.
  3. Run Remove Empty Attributes.

The command scans the active editor and removes only attributes whose value is an empty string.

Development

  1. Run npm install
  2. Run npm run watch
  3. Press F5 in VS Code to launch the Extension Development Host
  4. Open an HTML, JSX, TSX, or JSP file in the new window
  5. Run Remove Empty Attributes from the Command Palette

Notes

  • This extension currently runs as a manual command.
  • It does not remove boolean attributes.
  • It does not change attributes with non-empty values.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft