prettier-plugin-html-inline-force-semi
v1.0.0
Published
Prettier plugin to ensure HTML inline attributes (style, functions) end with a semicolon
Downloads
28
Maintainers
Readme
prettier-plugin-html-inline-force-semi
Should work in HTML and Angular HTML parsers
Installation
Run: npm install prettier-plugin-html-inline-force-semi --save-dev
Add to plugins in prettier options, e.g: { "plugins": ["prettier-plugin-html-inline-force-semi"] }
Prettier options:
Values
htmlForceSemiOn = "style" | "all" | "angularEvent" | "never"
- default = "style"
Example config
{
...,
"plugins": ["prettier-plugin-html-inline-force-semi"],
"htmlForceSemiOn": "style"
}
Examples
style (including all)
Before
<div style="text-align: right; margin: 6px 0">Hello World</div>
After
<div style="text-align: right; margin: 6px 0;">Hello World</div>
angularEvent (including all)
Before
<button (click)="myFunction()">Hello World</button>
After
<button (click)="myFunction();">Hello World</button>