43081j / eslint-plugin-lit

lit-html support for ESLint
116 stars 21 forks source link

new rule: prefer-nothing #139

Closed 43081j closed 1 year ago

43081j commented 1 year ago

As of lit 2 you can now use the nothing constant to render nothing:

render() {
  if (!foo) {
    return nothing;
  }

  return html` ... `;
}

this means there's probably no reason anymore for empty templates like this:

render() {
  if (!foo) {
    return html``;
  }
}