Skip to content
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

[FEATURE] Linter rule idea: for must match id in same file #820

Open
2 tasks done
silverwind opened this issue Mar 15, 2024 · 0 comments
Open
2 tasks done

[FEATURE] Linter rule idea: for must match id in same file #820

silverwind opened this issue Mar 15, 2024 · 0 comments

Comments

@silverwind
Copy link

silverwind commented Mar 15, 2024

Feature Request

A new rule that each for attribute on <label> has a exactly one matching id in the same file would be nice.

Failure:

<label for="wine"></label>
<input id="cheese">
<label for="wine"></label>
<input id="cheese">
<input id="cheese">

Success:

<label for="cheese"></label>
<input id="cheese">

In case elements are spread across multiple files it would produce false-positives, but I think such cases would be rare enough to not present a major issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant