prettier-plugin-html-no-eq-empty
v0.0.1
Published
A prettier plugin to remove `=""` from HTML attributes
Downloads
4
Maintainers
Readme
prettier-plugin-html-no-eq-empty
Remove empty HTML attributes (those pesky =""
s).
Installation
npm i -D prettier-plugin-html-no-eq-empty
Usage
Add the following to your prettier.config.js
:
export default {
// add the plugin
plugins: ['prettier-plugin-html-no-eq-empty'],
};
Example
<!-- Before -->
<div data-bruh=""></div>
<!-- After -->
<div data-bruh></div>
Excluded Attributes
Certain attributes are hard-coded to be excluded from being stripped:
alt
src
href
url
name
class
id
If you want to add or remove attributes from this list, you can either submit a PR, or just copy & paste the plugin into your project (it's one file!).
export default {
// add the plugin
plugins: ['./path/to/your/prettier-plugin-html-no-eq-empty.js'],
};
License
MIT