Prettier 3.7.1
Playground link
Input:
function myComponent() {
return /* HTML */ `
<div class="${styles.banner}">
</div>
`;
}
Output:
function myComponent() {
return /* HTML */ ` <div class=${styles.banner}></div> `;
}
Expected output:
function myComponent() {
return /* HTML */ ` <div class="${styles.banner}"></div> `;
}
Why?
Prior to version 3.7.0, the quotes were not removed. Now, it is necessary to add <!-- prettier-ignore --> for such strings.
Prettier 3.7.1
Playground link
Input:
Output:
Expected output:
Why?
Prior to version 3.7.0, the quotes were not removed. Now, it is necessary to add
<!-- prettier-ignore -->for such strings.