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

fix(docs/rules): add missing category tags to rules metadata #2569

Merged
merged 2 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build/tasks/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ function createSchemas() {
type: 'array',
items: {
type: 'string'
},
conform: function hasCategoryTag(tags) { return tags.some(tag => tag.includes('cat.')) },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I like this check. Thanks for adding this.

messages: {
conform: 'must include a category tag'
}
},
matches: {
Expand Down
78 changes: 39 additions & 39 deletions doc/rule-descriptions.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/rules/accesskeys.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "accesskeys",
"selector": "[accesskey]",
"excludeHidden": false,
"tags": ["best-practice", "cat.keyboard"],
"tags": ["cat.keyboard", "best-practice"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I swapped the positioning here to better match the order of the other rules' tags.

"metadata": {
"description": "Ensures every accesskey attribute value is unique",
"help": "accesskey attribute value must be unique"
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/aria-input-field-name.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "aria-input-field-name",
"selector": "[role=\"combobox\"], [role=\"listbox\"], [role=\"searchbox\"], [role=\"slider\"], [role=\"spinbutton\"], [role=\"textbox\"]",
"matches": "aria-form-field-name-matches",
"tags": ["wcag2a", "wcag412"],
"tags": ["cat.aria", "wcag2a", "wcag412"],
"metadata": {
"description": "Ensures every ARIA input field has an accessible name",
"help": "ARIA input fields must have an accessible name"
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/aria-toggle-field-name.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "aria-toggle-field-name",
"selector": "[role=\"checkbox\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"], [role=\"radio\"], [role=\"switch\"]",
"matches": "aria-form-field-name-matches",
"tags": ["wcag2a", "wcag412"],
"tags": ["cat.aria", "wcag2a", "wcag412"],
"metadata": {
"description": "Ensures every ARIA toggle field has an accessible name",
"help": "ARIA toggle fields have an accessible name"
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/aria-tooltip-name.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "aria-tooltip-name",
"selector": "[role=\"tooltip\"]",
"matches": "aria-form-field-name-matches",
"tags": ["wcag2a", "wcag412"],
"tags": ["cat.aria", "wcag2a", "wcag412"],
"metadata": {
"description": "Ensures every ARIA tooltip node has an accessible name",
"help": "ARIA tooltip ndoes must have an accessible name"
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/avoid-inline-spacing.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "avoid-inline-spacing",
"selector": "[style]",
"tags": ["wcag21aa", "wcag1412"],
"tags": ["cat.structure", "wcag21aa", "wcag1412"],
"metadata": {
"description": "Ensure that text spacing set through style attributes can be adjusted with custom stylesheets",
"help": "Inline text spacing must be adjustable with custom stylesheets"
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/identical-links-same-purpose.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"selector": "a[href], area[href], [role=\"link\"]",
"excludeHidden": false,
"matches": "identical-links-same-purpose-matches",
"tags": ["wcag2aaa", "wcag249", "best-practice"],
"tags": ["cat.semantics", "wcag2aaa", "wcag249", "best-practice"],
"metadata": {
"description": "Ensure that links with the same accessible name serve a similar purpose",
"help": "Links with the same name have a similar purpose"
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/label-content-name-mismatch.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "label-content-name-mismatch",
"matches": "label-content-name-mismatch-matches",
"tags": ["wcag21a", "wcag253", "experimental"],
"tags": ["cat.semantics", "wcag21a", "wcag253", "experimental"],
"metadata": {
"description": "Ensures that elements labelled through their content must have their visible text as part of their accessible name",
"help": "Elements must have their visible text as part of their accessible name"
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-autoplay-audio.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"excludeHidden": false,
"selector": "audio[autoplay], video[autoplay]",
"matches": "no-autoplay-audio-matches",
"tags": ["wcag2a", "wcag142", "experimental"],
"tags": ["cat.time-and-media", "wcag2a", "wcag142", "experimental"],
"metadata": {
"description": "Ensures <video> or <audio> elements do not autoplay audio for more than 3 seconds without a control mechanism to stop or mute the audio",
"help": "<video> or <audio> elements do not autoplay audio"
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/scrollable-region-focusable.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "scrollable-region-focusable",
"matches": "scrollable-region-focusable-matches",
"tags": ["wcag2a", "wcag211"],
"tags": ["cat.keyboard", "wcag2a", "wcag211"],
"metadata": {
"description": "Elements that have scrollable content should be accessible by keyboard",
"help": "Ensure that scrollable region has keyboard access"
Expand Down