From 17dae91b3ecb77efed26ec7f4457aadd46cc1b3c Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Sun, 30 Oct 2022 11:14:50 -0400 Subject: [PATCH] [Docs] missing descriptions in some rules --- .eslintrc | 1 + README.md | 80 ++++++++++++------------ docs/rules/label-has-for.md | 9 ++- src/rules/accessible-emoji.js | 1 + src/rules/label-has-for.js | 2 + src/rules/no-aria-hidden-on-focusable.js | 5 +- src/rules/prefer-tag-over-role.js | 1 + 7 files changed, 54 insertions(+), 45 deletions(-) diff --git a/.eslintrc b/.eslintrc index a94e7cb6a..7024a688d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -21,6 +21,7 @@ "files": ["src/rules/*"], "extends": ["plugin:eslint-plugin/rules-recommended"], "rules": { + "eslint-plugin/require-meta-docs-description": ["error", { "pattern": "^(Enforce|Require|Disallow)" }], "eslint-plugin/require-meta-docs-url": [ "error", { "pattern": "https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/{{name}}.md" }, diff --git a/README.md b/README.md index d74fc210e..07b61faf3 100644 --- a/README.md +++ b/README.md @@ -118,46 +118,46 @@ configuration file by mapping each custom component name to a DOM element type. πŸ”’ Enabled in the `strict` configuration.\ ❌ Deprecated. -| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ❌ | -| :----------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- | :---- | :-- | -| [accessible-emoji](docs/rules/accessible-emoji.md) | | | ❌ | -| [alt-text](docs/rules/alt-text.md) | Enforce all elements that require alternative text have meaningful information to relay back to end user. | β˜‘οΈ πŸ”’ | | -| [anchor-ambiguous-text](docs/rules/anchor-ambiguous-text.md) | Enforce `` text to not exactly match "click here", "here", "link", or "a link". | | | -| [anchor-has-content](docs/rules/anchor-has-content.md) | Enforce all anchors to contain accessible content. | β˜‘οΈ πŸ”’ | | -| [anchor-is-valid](docs/rules/anchor-is-valid.md) | Enforce all anchors are valid, navigable elements. | β˜‘οΈ πŸ”’ | | -| [aria-activedescendant-has-tabindex](docs/rules/aria-activedescendant-has-tabindex.md) | Enforce elements with aria-activedescendant are tabbable. | β˜‘οΈ πŸ”’ | | -| [aria-props](docs/rules/aria-props.md) | Enforce all `aria-*` props are valid. | β˜‘οΈ πŸ”’ | | -| [aria-proptypes](docs/rules/aria-proptypes.md) | Enforce ARIA state and property values are valid. | β˜‘οΈ πŸ”’ | | -| [aria-role](docs/rules/aria-role.md) | Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role. | β˜‘οΈ πŸ”’ | | -| [aria-unsupported-elements](docs/rules/aria-unsupported-elements.md) | Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes. | β˜‘οΈ πŸ”’ | | -| [autocomplete-valid](docs/rules/autocomplete-valid.md) | Enforce that autocomplete attributes are used correctly. | β˜‘οΈ πŸ”’ | | -| [click-events-have-key-events](docs/rules/click-events-have-key-events.md) | Enforce a clickable non-interactive element has at least one keyboard event listener. | β˜‘οΈ πŸ”’ | | -| [control-has-associated-label](docs/rules/control-has-associated-label.md) | Enforce that a control (an interactive element) has a text label. | | | -| [heading-has-content](docs/rules/heading-has-content.md) | Enforce heading (`h1`, `h2`, etc) elements contain accessible content. | β˜‘οΈ πŸ”’ | | -| [html-has-lang](docs/rules/html-has-lang.md) | Enforce `` element has `lang` prop. | β˜‘οΈ πŸ”’ | | -| [iframe-has-title](docs/rules/iframe-has-title.md) | Enforce iframe elements have a title attribute. | β˜‘οΈ πŸ”’ | | -| [img-redundant-alt](docs/rules/img-redundant-alt.md) | Enforce `` alt prop does not contain the word "image", "picture", or "photo". | β˜‘οΈ πŸ”’ | | -| [interactive-supports-focus](docs/rules/interactive-supports-focus.md) | Enforce that elements with interactive handlers like `onClick` must be focusable. | β˜‘οΈ πŸ”’ | | -| [label-has-associated-control](docs/rules/label-has-associated-control.md) | Enforce that a `label` tag has a text label and an associated control. | β˜‘οΈ πŸ”’ | | -| [label-has-for](docs/rules/label-has-for.md) | | | ❌ | -| [lang](docs/rules/lang.md) | Enforce lang attribute has a valid value. | | | -| [media-has-caption](docs/rules/media-has-caption.md) | Enforces that `
`) that have click handlers use the role attribute. | β˜‘οΈ πŸ”’ | | -| [prefer-tag-over-role](docs/rules/prefer-tag-over-role.md) | | | | -| [role-has-required-aria-props](docs/rules/role-has-required-aria-props.md) | Enforce that elements with ARIA roles must have all required attributes for that role. | β˜‘οΈ πŸ”’ | | -| [role-supports-aria-props](docs/rules/role-supports-aria-props.md) | Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | β˜‘οΈ πŸ”’ | | -| [scope](docs/rules/scope.md) | Enforce `scope` prop is only used on `` elements. | β˜‘οΈ πŸ”’ | | -| [tabindex-no-positive](docs/rules/tabindex-no-positive.md) | Enforce `tabIndex` value is not greater than zero. | β˜‘οΈ πŸ”’ | | +| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | ❌ | +| :- | :- | :- | :- | +| [accessible-emoji](docs/rules/accessible-emoji.md) | Enforce emojis are wrapped in `` and provide screenreader access. | | ❌ | +| [alt-text](docs/rules/alt-text.md) | Enforce all elements that require alternative text have meaningful information to relay back to end user. | β˜‘οΈ πŸ”’ | | +| [anchor-ambiguous-text](docs/rules/anchor-ambiguous-text.md) | Enforce `` text to not exactly match "click here", "here", "link", or "a link". | | | +| [anchor-has-content](docs/rules/anchor-has-content.md) | Enforce all anchors to contain accessible content. | β˜‘οΈ πŸ”’ | | +| [anchor-is-valid](docs/rules/anchor-is-valid.md) | Enforce all anchors are valid, navigable elements. | β˜‘οΈ πŸ”’ | | +| [aria-activedescendant-has-tabindex](docs/rules/aria-activedescendant-has-tabindex.md) | Enforce elements with aria-activedescendant are tabbable. | β˜‘οΈ πŸ”’ | | +| [aria-props](docs/rules/aria-props.md) | Enforce all `aria-*` props are valid. | β˜‘οΈ πŸ”’ | | +| [aria-proptypes](docs/rules/aria-proptypes.md) | Enforce ARIA state and property values are valid. | β˜‘οΈ πŸ”’ | | +| [aria-role](docs/rules/aria-role.md) | Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role. | β˜‘οΈ πŸ”’ | | +| [aria-unsupported-elements](docs/rules/aria-unsupported-elements.md) | Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes. | β˜‘οΈ πŸ”’ | | +| [autocomplete-valid](docs/rules/autocomplete-valid.md) | Enforce that autocomplete attributes are used correctly. | β˜‘οΈ πŸ”’ | | +| [click-events-have-key-events](docs/rules/click-events-have-key-events.md) | Enforce a clickable non-interactive element has at least one keyboard event listener. | β˜‘οΈ πŸ”’ | | +| [control-has-associated-label](docs/rules/control-has-associated-label.md) | Enforce that a control (an interactive element) has a text label. | | | +| [heading-has-content](docs/rules/heading-has-content.md) | Enforce heading (`h1`, `h2`, etc) elements contain accessible content. | β˜‘οΈ πŸ”’ | | +| [html-has-lang](docs/rules/html-has-lang.md) | Enforce `` element has `lang` prop. | β˜‘οΈ πŸ”’ | | +| [iframe-has-title](docs/rules/iframe-has-title.md) | Enforce iframe elements have a title attribute. | β˜‘οΈ πŸ”’ | | +| [img-redundant-alt](docs/rules/img-redundant-alt.md) | Enforce `` alt prop does not contain the word "image", "picture", or "photo". | β˜‘οΈ πŸ”’ | | +| [interactive-supports-focus](docs/rules/interactive-supports-focus.md) | Enforce that elements with interactive handlers like `onClick` must be focusable. | β˜‘οΈ πŸ”’ | | +| [label-has-associated-control](docs/rules/label-has-associated-control.md) | Enforce that a `label` tag has a text label and an associated control. | β˜‘οΈ πŸ”’ | | +| [label-has-for](docs/rules/label-has-for.md) | Enforce that `