-
Notifications
You must be signed in to change notification settings - Fork 791
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
feat: separate form-field-multiple-label from label rule #1226
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
662c6db
fix: make multiple-label a best-practice rule
jeeyyy e51025d
test: add integration tests for multiple-label rule
jeeyyy 9b720f8
Merge branch 'develop' into rule-multiple-label
jeeyyy 2636263
fix: update rule name and add integration tests
jeeyyy a4020e8
fix: update check and rule messages
jeeyyy ae2a8f7
Merge branch 'develop' into rule-multiple-label
jeeyyy f91bd38
docs: update rule descriptions
jeeyyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
], | ||
"none": [ | ||
"help-same-as-label", | ||
"multiple-label", | ||
"hidden-explicit-label" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"id": "multiple-label", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm inclined to name this something like "form-field-multiple-labels"? |
||
"selector": "input, select, textarea", | ||
"matches": "label-matches.js", | ||
"tags": [ | ||
"best-practice", | ||
"cat.forms", | ||
"wcag2a", | ||
"wcag332" | ||
], | ||
"metadata": { | ||
"description": "Ensures form element does not have multiple label elements", | ||
"help": "Form element must not have multiple associated label elements" | ||
}, | ||
"all": [], | ||
"any": [], | ||
"none": [ | ||
"multiple-label" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
["#fail10"], | ||
["#fail11"], | ||
["#fail22"], | ||
["#fail23"], | ||
["#fail24"], | ||
["#fail25"], | ||
["#fail26"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!-- Fail --> | ||
<label for="fail1">Hi</label> | ||
<label for="fail1">Foo</label> | ||
<input type="text" id="fail1"> | ||
|
||
<label for="fail2">label one</label> | ||
<label for="fail2">label two</label> | ||
<input type="checkbox" id="fail2"> | ||
|
||
<label for="fail3" id="l1">label one</label> | ||
<label for="fail3">label two</label> | ||
<input type="checkbox" id="fail3" aria-labelledby="l1"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should add tests for:
|
||
|
||
<!-- Pass --> | ||
<label for="pass1">Label</label><input type="text" id="pass1"> | ||
<textarea id="pass2" title="Label"></textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"description": "multiple label test", | ||
"rule": "multiple-label", | ||
"violations": [ | ||
["#fail1"], | ||
["#fail2"], | ||
["#fail3"] | ||
], | ||
"passes": [ | ||
["#pass1"], | ||
["#pass2"] | ||
] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should change the impact to "moderate" for this. Best practices should not have an impact that is serious or critical. People don't like it when we do that :-)