The error message "Trailing slash on void elements has no effect" typically occurs when using HTML self-closing void elements with a trailing slash ("/") at the end. Void elements in HTML, such as <img>, <input>, and <br>, do not require a closing tag and should not have a trailing slash.
For example, if you have code like this:
<img src="image.jpg" />
Prettier may format it as:
<img src="image.jpg">
To resolve this issue, you can simply remove the trailing slash on void element (like in the second source sample above)
Btw if you don't need that specific check you can overwrite it in your .prettierrc or prettier.config.js file.
e.g.
module.exports = {
overrides: [
{
files: '*.html',
options: {
...
// Add the rule you want to disable
htmlVoidTags: false,
},
},
],
};