yeonjuan / html-eslint

ESLint plugin for linting HTML
https://html-eslint.org
MIT License
147 stars 28 forks source link

Feature request: use this with HTML in Javascript template literals #196

Open RobertAKARobin opened 2 weeks ago

RobertAKARobin commented 2 weeks ago

The /*html*//html template literal syntax is used by several libraries, like Lit:

const myTemplate = /*html*/`
<div>
  <h1>Hello, world!</h1>
</div>
`;

document.body.innerHTML = myTemplate;

It would be nice if html-eslint could be run on Javascript template literals like this.

See also https://github.com/pushqrdx/vscode-inline-html

yeonjuan commented 2 weeks ago

@RobertAKARobin Agree! Thanks for the suggestion. I can't think of a way to implement this off the top of my head, but it seems like a useful feature.