-
-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
label-has-associated-control and label-has-for complaining in my .ts files #869
Comments
Can you share the code that’s being warned? |
I am having this problem as well. I am receiving the following linting errors:
which correspond to the following lines in my "offending" tsx file:
My dependency version is |
@clarknc i agree, that should be valid. You should be using |
I've made the suggested version change to my packjage.json and removed/reinstalled the dependency, but the problem seems to still be occurring. |
Same here with // real app code
<label style={{ marginLeft: 20 }}>
<input
type="checkbox"
onChange={(evt) => setReadonly(evt.target.checked)}
/>
Read only mode
</label> // from docs
<label>
Surname
<input type="text" />
</label> |
@kachkaev those both also need an ID and a "for" to link the label and input. |
Hmm why should the last example fail? I copied it from rule docs. |
It depends on what the |
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390.
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390.
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
* We no longer need to care about nanoid v3 thinking "browser === esm", because the GB package that had that dep no longer does. * Various `jsx-a11y/label-has-associated-control` ignores referring to jsx-eslint/eslint-plugin-jsx-a11y#869 seem to be fixed now that #39736 requires we use `htmlFor`. The one place still needing an ignore is jsx-eslint/eslint-plugin-jsx-a11y#578 instead. * Remove reference to deleted renovate issue. * Move reference to a Storybook bug to the code actually implementing the workaround. * Update Storybook FAQ reference. * Remove TODO references to a fixed Storybook bug (and fix a wrong prop in one story). * Remove workaround for WordPress/WordPress-Coding-Standards#2390. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11896972496 Upstream-Ref: Automattic/jetpack@62e385b
I have .ts services/data store files in my React projects where I'm receiving complaints about the above linting errors. I literally cannot fix those issues to the satisfaction of ESLint, as I haven't written any JSX in those files, only JS/TS.
The text was updated successfully, but these errors were encountered: