Skip to content

linter: jsx-a11y/control-has-associated-label false positive when input is inside label #22606

Description

@xt0rted

What version of Oxlint are you using?

1.66.0

What command did you run?

oxlint

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

Seen using the default config on the Oxc Playground link from the rule page https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/control-has-associated-label.html#references

What happened?

An input inside of a label is flagged as not associated with a label. This contradicts the example code on the rule page that says this is the correct way to do it.

<label>Name <input type="text" /></label>

Rule: https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/control-has-associated-label.html
Error example: https://playground.oxc.rs/?lintRules=jsx-a11y%2Fcontrol-has-associated-label

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions