0.0.1 • Published 1 year ago
prettier-plugin-html-no-eq-empty v0.0.1
prettier-plugin-html-no-eq-empty
Remove empty HTML attributes (those pesky =""s).
Installation
npm i -D prettier-plugin-html-no-eq-emptyUsage
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:
altsrchrefurlnameclassid
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
0.0.1
1 year ago