This rule is almost the same as no-undef
, and optimize some cases for babel-plugin-react-directives
Undefined variables are ignored under directive x-for
function Foo() {
const list = [1, 2, 3];
return (
<ul>
<li x-for={(item, index) in list} key={item}>
<span>{item}</span>
</li>
</ul>
)
}
function Foo() {
const list = [1, 2, 3];
return (
<ul>
<li x-for={(item, index) in list}></li>
{item}
</ul>
)
}