astro/no-unused-define-vars-in-style
disallow unused
define:vars={...}
instyle
tag
- ⚙ This rule is included in
"plugin:astro/recommended"
.
📖 Rule Details
This rule is aimed at eliminating unused defined variables in define:vars={...}
in style
tag.
---
/* eslint astro/no-unused-define-vars-in-style: "error" */
---
{/* ✓ GOOD */}
<style define:vars={{ foregroundColor, backgroundColor }}>
h1 {
background-color: var(--backgroundColor);
color: var(--foregroundColor);
}
</style>
{/* ✗ BAD */}
<style define:vars={{ foregroundColor, backgroundColor }}>
h1 {
background-color: var(--background);
color: var(--foreground);
}
</style>
🔧 Options
Nothing.
📚 Further Reading
🚀 Version
This rule was introduced in eslint-plugin-astro v0.6.0
🔍 Implementation
Edit this page
Back
← astro/no-exports-from-components Next Page
astro/valid-compile →
← astro/no-exports-from-components Next Page
astro/valid-compile →