eslint-plugin-jsx-a11y: label-has-associated-control documentation incorrect

Hi,

https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/v6.1.0/docs/rules/label-has-associated-control.md

Example still shows label-has-for. I can do a really quick easy PR to fix it, but need access.

Cheers

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

@jessebeach I used this and it worked:

    "jsx-a11y/label-has-associated-control": [ 2, {
    "labelComponents": ["label"],
    "labelAttributes": ["htmlFor"],
    "controlComponents": ["input"]
  }]

Any updates on the issue?

This is what’s needed for me to make the rules pass

    'jsx-a11y/label-has-associated-control': [
      2,
      {
        labelComponents: ['label'],
      },
    ],

@jessebeach I used this and it worked:

    "jsx-a11y/label-has-associated-control": [ 2, {
    "labelComponents": ["label"],
    "labelAttributes": ["htmlFor"],
    "controlComponents": ["input"]
  }]

Works for me!!

when i supplied any rule config like

  "jsx-a11y/label-has-associated-control": [ 2, {
	...
  }]

it passed, but if i didn’t specify that config it should work too , that is the problem

You don’t need any access to make a PR; PRs are typically made from personal forks.

It’d be great to also add docs for the assert option.