Skip to content

Commit

Permalink
eslint: Remove jsx-a11y/label-has-associated-control override (#39736)
Browse files Browse the repository at this point in the history
`@wordpress/eslint-plugin` sets `jsx-a11y/label-has-associated-control`
to "htmlFor", while we had it overridden to "either". Turns out there
was only place that wasn't already doing "htmlFor", so let's fix that
one place and go for it.

This also removes `jsx-a11y/label-has-for` which is deprecated in favor
of `jsx-a11y/label-has-associated-control`. The former config was
equivalent to "either".

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11281457159

Upstream-Ref: Automattic/jetpack@89f5928
  • Loading branch information
anomiex authored and matticbot committed Oct 10, 2024
1 parent 87df410 commit eb45100
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 86 deletions.
58 changes: 29 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const FormLabel: FunctionComponent< Props & LabelProps > = ( {
const hasChildren: boolean = Children.count( children ) > 0;

return (
// eslint-disable-next-line jsx-a11y/label-has-for
// eslint-disable-next-line jsx-a11y/label-has-associated-control
<label { ...labelProps } className={ clsx( className, 'form-label' ) }>
{ children }
{ hasChildren && required && (
Expand Down
Loading

0 comments on commit eb45100

Please sign in to comment.