VS Code Extensions
R

remove-empty-attribute

by LucaPark

Remove empty HTML-like attributes from the active editor.

Downloads

6

Rating

— (0)

Version

0.0.1

Last updated

Apr 22, 2026

한국어 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.

Related extensions