astro/no-set-text-directive
disallow use of
set:text
- 🔧 The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
📖 Rule Details
This rule reports all uses of set:text
directive.
The documentation says about the set:text
directive as follows:
This is equivalent to just passing a variable into a template expression directly (ex:
<div>{someText}</div>
) and therefore this directive is not commonly used.
See Astro Documentation | Template Directives Reference > set:text.
---
/* eslint astro/no-set-text-directive: "error" */
---
{/* ✓ GOOD */}
<p>{foo}</p>
{/* ✗ BAD */}
<p set:text={foo} />
🔧 Options
Nothing.
📚 Further Reading
🚀 Version
This rule was introduced in eslint-plugin-astro v0.2.0
🔍 Implementation
Edit this page
Back
← astro/no-set-html-directive Next Page
astro/no-unused-css-selector →
← astro/no-set-html-directive Next Page
astro/no-unused-css-selector →