rule "label-has-associated-control" from plugin:astro/jsx-a11y uses react htmlFor instead for #123
Closed
2 tasks done
Labels
bug
Something isn't working
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
7.32.0 (not the latest I know but it does not matter)
What version of
eslint-plugin-astro
are you using?0.20.0
What did you do?
Configuration
What did you expect to happen?
No errors from ESLint
What actually happened?
ESLint complains that
htmlFor
attribute is not defined on labels.Link to Minimal Reproducible Example
https://github.com/xididri/astro-eslint-jsx-a11y
Additional comments
In React components we must use
htmlFor
instead offor
since it is a reserved keyword (same reason whyclassName
is used instead ofclass
). Resulting HTML hasfor
.In Astro there is no such a thing, therefore the rule should be adapted to check for
for
attribute instead ofhtmlFor
.edit: Forgot to include the error message:
The text was updated successfully, but these errors were encountered: