jsx-eslint / eslint-plugin-jsx-a11y

Static AST checker for a11y rules on JSX elements.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsx-a11y/label-has-associated-control gives error when for is put

TheElegantCoding opened this issue · comments

This is my config

'jsx-a11y/label-has-associated-control': 'error'

i am not in react i use "for", this make me error in the code only when i put htmlFor works but i cant do that i dont use react

return (
  <>
    <label for="email" />
    <input id="email" name="email" type="text" />
  </>
)

Most jsx renderers match react, since react invented jsx. It’d be reasonable to add a setting that can rename htmlFor as “for”, i suppose.

not all jsx renderes match that, i am in solidjs so yeah it will be nice

It's missing aria-label attribute in the label element