Skip to content

Commit da3be73

Browse files
committed
Rename rules and reorganize documentation. (#37)
* [rename] - Rename aria-role-supports-attribute to role-supports-aria-props * [rename] - rename avoid-positive-tabindex to tabindex-no-positive * [rename] - rename img-uses-alt to img-has-alt * [rename] - rename label-uses-for to label-has-for * [rename] - rename mouse-events-map-to-key-events to mouse-events-have-key-events * [rename] - rename no-hash-href to href-no-hash * [rename] - no-invalid-aria to aria-props * [rename] - Rename no-unsupported-elements-use-aria to aria-unsupported-elements * [rename] - Rename onclick-uses-role to onclick-has-role * [rename] - Rename redundant-alt to img-redundant-alt * [rename] - Rename use-onblur-not-onchange to no-onchange * [rename] - Rename valid-aria-role to aria-role * [rename] - Rename rule valid-aria-proptypes to aria-proptypes * [rename] - Rename role-requires-aria to role-has-required-aria-props * [cleanup] - Clean up READMEs and alphabetize rules.
1 parent 9b22d92 commit da3be73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+91
-89
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,22 @@ Then configure the rules you want to use under the rules section.
7070

7171
## Supported Rules
7272

73-
- [aria-role-supports-attribute](docs/rules/aria-role-supports-attribute.md): Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`.
74-
- [avoid-positive-tabindex](docs/rules/avoid-positive-tabindex.md): Enforce `tabIndex` value is not greater than zero.
75-
- [img-uses-alt](docs/rules/img-uses-alt.md): Enforce that `<img>` JSX elements use the `alt` prop.
76-
- [label-uses-for](docs/rules/label-uses-for.md): Enforce that `<label>` elements have the `htmlFor` prop.
77-
- [mouse-events-map-to-key-events](docs/rules/mouse-events-map-to-key-events.md): Enforce that `onMouseOver`/`onMouseOut` are accompanied by `onFocus`/`onBlur` for keyboard-only users.
73+
- [aria-props](docs/rules/aria-props.md): Enforce all `aria-*` props are valid.
74+
- [aria-proptypes](docs/rules/aria-proptypes.md): Enforce ARIA state and property values are valid.
75+
- [aria-role](docs/rules/aria-role.md): Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
76+
- [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.
77+
- [href-no-hash](docs/rules/href-no-hash.md): Enforce an anchor element's `href` prop value is not just `#`.
78+
- [img-has-alt](docs/rules/img-has-alt.md): Enforce that `<img>` JSX elements use the `alt` prop.
79+
- [img-redundant-alt](docs/rules/img-redundant-alt.md): Enforce `<img>` alt prop does not contain the word "image", "picture", or "photo".
80+
- [label-has-for](docs/rules/label-has-for.md): Enforce that `<label>` elements have the `htmlFor` prop.
81+
- [mouse-events-have-key-events](docs/rules/mouse-events-have-key-events.md): Enforce that `onMouseOver`/`onMouseOut` are accompanied by `onFocus`/`onBlur` for keyboard-only users.
7882
- [no-access-key](docs/rules/no-access-key.md): Enforce that the `accessKey` prop is not used on any element to avoid complications with keyboard commands used by a screenreader.
79-
- [no-hash-href](docs/rules/no-hash-href.md): Enforce an anchor element's `href` prop value is not just `#`.
80-
- [no-invalid-aria](docs/rules/no-invalid-aria.md): Enforce all `aria-*` props are valid.
81-
- [no-unsupported-elements-use-aria](docs/rules/no-unsupported-elements-use-aria.md): Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes.
83+
- [no-onchange](docs/rules/no-onchange.md): Enforce that `onBlur` is used instead of `onChange`.
8284
- [onclick-has-focus](docs/rules/onclick-has-focus.md): Enforce that elements with `onClick` handlers must be focusable.
83-
- [onclick-uses-role](docs/rules/onclick-uses-role.md): Enforce that non-interactive, visible elements (such as `<div>`) that have click handlers use the role attribute.
84-
- [redundant-alt](docs/rules/redundant-alt.md): Enforce `<img>` alt prop does not contain the word "image", "picture", or "photo".
85-
- [role-requires-aria](docs/rules/role-requires-aria.md): Enforce that elements with ARIA roles must have all required attributes for that role.
86-
- [use-onblur-not-onchange](docs/rules/use-onblur-not-onchange.md): Enforce that `onBlur` is used instead of `onChange`.
87-
- [valid-aria-proptype](docs/rules/valid-aria-proptype.md): Enforce ARIA state and property values are valid.
88-
- [valid-aria-role](docs/rules/valid-aria-role.md): Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
85+
- [onclick-has-role](docs/rules/onclick-has-role.md): Enforce that non-interactive, visible elements (such as `<div>`) that have click handlers use the role attribute.
86+
- [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.
87+
- [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`.
88+
- [tabindex-no-positive](docs/rules/tabindex-no-positive.md): Enforce `tabIndex` value is not greater than zero.
8989

9090
## License
9191

docs/rules/no-invalid-aria.md renamed to docs/rules/aria-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# no-invalid-aria
1+
# aria-props
22

33
Elements cannot use an invalid ARIA attribute. This will fail if it finds an `aria-*` property that is not listed in [WAI-ARIA States and Properties spec](https://www.w3.org/TR/wai-aria/states_and_properties#state_prop_def).
44

docs/rules/valid-aria-proptype.md renamed to docs/rules/aria-proptypes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# valid-aria-proptype
1+
# aria-proptypes
22

33
ARIA state and property values must be valid.
44

docs/rules/valid-aria-role.md renamed to docs/rules/aria-role.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# valid-aria-role
1+
# aria-role
22

33
Elements with ARIA roles must use a valid, non-abstract ARIA role. A reference to all role defintions can be found at [WAI-ARIA](https://www.w3.org/TR/wai-aria/roles#role_definitions) site.
44

docs/rules/no-unsupported-elements-use-aria.md renamed to docs/rules/aria-unsupported-elements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# no-unsupported-elements-use-aria
1+
# aria-unsupported-elements
22

33
Certain reserved DOM elements do not support ARIA roles, states and properties. This is often because they are not visible, for example `meta`, `html`, `script`, `style`. This rule enforces that these DOM elements do not contain the `role` and/or `aria-*` props.
44

docs/rules/no-hash-href.md renamed to docs/rules/href-no-hash.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# no-hash-href
1+
# href-no-hash
22

33
Enforce an anchor element's href prop value is not just #. You should use something more descriptive, or use a button instead.
44

@@ -26,8 +26,8 @@ To tell this plugin to also check your `Link` element, specify this in your `.es
2626
```json
2727
{
2828
"rules": {
29-
"jsx-a11y/no-hash-href": [ 2, "Link" ], // OR
30-
"jsx-a11y/no-hash-href": [ 2, [ "Link", "Anchor" ] ]
29+
"jsx-a11y/href-no-hash": [ 2, "Link" ], // OR
30+
"jsx-a11y/href-no-hash": [ 2, [ "Link", "Anchor" ] ]
3131
}
3232
}
3333
```

docs/rules/img-uses-alt.md renamed to docs/rules/img-has-alt.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# img-uses-alt
1+
# img-has-alt
22

33
Enforce that an `img` element contains the `alt` prop. The `alt` attribute specifies an alternate text for an image, if the image cannot be displayed.
44

@@ -35,8 +35,8 @@ To tell this plugin to also check your `Image` element, specify this in your `.e
3535
```json
3636
{
3737
"rules": {
38-
"jsx-a11y/img-uses-alt": [ 2, "Image" ], <!-- OR -->
39-
"jsx-a11y/img-uses-alt": [ 2, [ "Image", "Avatar" ] ]
38+
"jsx-a11y/img-has-alt": [ 2, "Image" ], <!-- OR -->
39+
"jsx-a11y/img-has-alt": [ 2, [ "Image", "Avatar" ] ]
4040
}
4141
}
4242
```

docs/rules/redundant-alt.md renamed to docs/rules/img-redundant-alt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# redundant-alt
1+
# img-redundant-alt
22

33
Enforce img alt attribute does not contain the word image, picture, or photo. Screenreaders already announce `img` elements as an image. There is no need to use words such as *image*, *photo*, and/or *picture*.
44

docs/rules/label-uses-for.md renamed to docs/rules/label-has-for.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# label-uses-for
1+
# label-has-for
22

33
Enforce label tags have htmlFor attribute. Form controls using a label to identify them must have only one label that is programmatically associated with the control using: label htmlFor=[ID of control].
44

@@ -36,8 +36,8 @@ To tell this plugin to also check your `Label` element, specify this in your `.e
3636
```json
3737
{
3838
"rules": {
39-
"jsx-a11y/label-uses-for": [ 2, "Label" ], // OR
40-
"jsx-a11y/label-uses-for": [ 2, [ "Label", "InputDescriptor" ] ]
39+
"jsx-a11y/label-has-for": [ 2, "Label" ], // OR
40+
"jsx-a11y/label-has-for": [ 2, [ "Label", "InputDescriptor" ] ]
4141
}
4242
}
4343
```

docs/rules/mouse-events-map-to-key-events.md renamed to docs/rules/mouse-events-have-key-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# mouse-events-map-to-key-events
1+
# mouse-events-have-key-events
22

33
Enforce onmouseover/onmouseout are accompanied by onfocus/onblur. Coding for the keyboard is important for users with physical disabilities who cannot use a mouse, AT compatability, and screenreader users.
44

0 commit comments

Comments
 (0)