Why isn't there an HTML linter in the same way there is ESLint for JavaScript?
https://www.w3.org/People/Raggett/tidy/
Search shows a few other options as well: https://duckduckgo.com/?q=html+linter&t=ftas&ia=web
Unless I'm misreading your question.