A Prettier plugin for Embedded JavaScript Templating (EJS).
npm install prettier-plugin-ejsThis plugin formats EJS markup in html files. It uses the default html parser and just marks EJS specific tags as comments.
``sh`
npm install --save-dev prettier-plugin-ejs
For Prettier v2, the plugin will be loaded automatically.
For Prettier v3, you'll need to manually load the plugin:
`sh`
prettier --plugin=prettier-plugin-ejs --write .
Please check Prettier Docs for other loading methods.
` html`
<% if (condition) { %> <% } else if (condition) { %> <% } %>
<%= 1 > 0 %>
<%= text %>
<%= text %>
` html`
<% if (condition) { %>
<% } else if (condition) { %>
<% } %>
<%= 1 > 0 %>
<%= text %>
<%= text %>
`html`
style="<%= styleData %>" <% } %>>
<%= data %>
<%= data %>
Tags which contains the greater then symbol >` are ignored.