css-no-empty-blocks

This rule disallows empty CSS blocks in <style> tags.

How to use

.eslintrc.js
module.exports = {
  rules: {
    "@html-eslint/css-no-empty-blocks": "error",
  },
};

Rule Details

Examples of incorrect code for this rule:

<style>
  a { }
</style>
<style>
  a { /* comment */ }
</style>
<style>
  @media print { }
</style>
<style>
  a {
  }
</style>

Examples of correct code for this rule:

<style>
  a { color: red; }
</style>
<style>
  @media print {
    a { color: black; }
  }
</style>