astro/no-unused-css-selector
disallow selectors defined in
style
tag that donβt use in HTML
π Rule Details
This rule aims to remove unused CSS selectors.
---
/* eslint astro/no-unused-css-selector: "error" */
---
<div class="foo">
<div class="bar">
</div>
</div>
<style>
/* β GOOD */
.foo,
.bar,
.foo > .bar {
color: red;
}
/* β BAD */
.unused,
.bar > .foo {
color: red;
}
</style>
π§ Options
Nothing.
π Version
This rule was introduced in eslint-plugin-astro v0.10.0
π Implementation
Edit this page
Back
β astro/no-set-text-directive Next Page
astro/prefer-class-list-directive β
β astro/no-set-text-directive Next Page
astro/prefer-class-list-directive β