Skip to content

Commit 47ab6e6

Browse files
lencionibeefancohen
authored andcommitted
Clean up readme a little (#33)
* Remove Contributing section from readme Most of the Chrome audit rules that make sense for this plugin have been implemented, and once we remove that sentence there's not really much left of this section so I ended up just removing it all. * Enable syntax highlighting for *sh code in readme * Use 2 spaces for indentation in JSON examples in readme 2 spaces seems pretty standard and also matches the indentation style of this project. * Sort list of rules alphabetically Having these rules in alphabetical order will make it easier to find what you are looking for and for future developers to know where to put new things. * Improve rule descriptions in readme This mostly adds backticks around things that represent code.
1 parent d79b788 commit 47ab6e6

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

README.md

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ Ryan Florence built out this awesome runtime-analysis tool called [react-a11y](h
3333

3434
You'll first need to install [ESLint](http://eslint.org):
3535

36-
```
36+
```sh
3737
$ npm i eslint --save-dev
3838
```
3939

4040
Next, install `eslint-plugin-jsx-a11y`:
4141

42-
```
42+
```sh
4343
$ npm install eslint-plugin-jsx-a11y --save-dev
4444
```
4545

@@ -51,9 +51,9 @@ Add `jsx-a11y` to the plugins section of your `.eslintrc` configuration file. Yo
5151

5252
```json
5353
{
54-
"plugins": [
55-
"jsx-a11y"
56-
]
54+
"plugins": [
55+
"jsx-a11y"
56+
]
5757
}
5858
```
5959

@@ -62,32 +62,29 @@ Then configure the rules you want to use under the rules section.
6262

6363
```json
6464
{
65-
"rules": {
66-
"jsx-a11y/rule-name": 2
67-
}
65+
"rules": {
66+
"jsx-a11y/rule-name": 2
67+
}
6868
}
6969
```
7070

7171
## Supported Rules
7272

73-
- [img-uses-alt](docs/rules/img-uses-alt.md): Enforce that img jsx elements use the alt attribute.
74-
- [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.
75-
- [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 strictly keyboard users.
76-
- [use-onblur-not-onchange](docs/rules/use-onblur-not-onchange.md): Enforce that onBlur is used instead of onChange.
77-
- [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.
78-
- [label-uses-for](docs/rules/label-uses-for.md): Enforce that label elements have the htmlFor attribute
79-
- [redundant-alt](docs/rules/redundant-alt.md): Enforce img alt attribute does not contain the word image, picture, or photo.
80-
- [no-hash-href](docs/rules/no-hash-href.md): Enforce an anchor element's href prop value is not just #.
81-
- [no-invalid-aria](docs/rules/no-invalid-aria.md): Enforce all aria-* properties are valid.
82-
- [valid-aria-role](docs/rules/valid-aria-role.md): Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
83-
- [valid-aria-proptype](docs/rules/valid-aria-proptype.md): Enforce ARIA state and property values are valid.
73+
- [avoid-positive-tabindex](docs/rules/avoid-positive-tabindex.md): Enforce `tabIndex` value is not greater than zero.
74+
- [img-uses-alt](docs/rules/img-uses-alt.md): Enforce that `<img>` JSX elements use the `alt` prop.
75+
- [label-uses-for](docs/rules/label-uses-for.md): Enforce that `<label>` elements have the `htmlFor` prop.
76+
- [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.
77+
- [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.
78+
- [no-hash-href](docs/rules/no-hash-href.md): Enforce an anchor element's `href` prop value is not just `#`.
79+
- [no-invalid-aria](docs/rules/no-invalid-aria.md): Enforce all `aria-*` props are valid.
80+
- [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.
81+
- [onclick-has-focus](docs/rules/onclick-has-focus.md): Enforce that elements with `onClick` handlers must be focusable.
82+
- [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.
83+
- [redundant-alt](docs/rules/redundant-alt.md): Enforce `<img>` alt prop does not contain the word "image", "picture", or "photo".
8484
- [role-requires-aria](docs/rules/role-requires-aria.md): Enforce that elements with ARIA roles must have all required attributes for that role.
85-
- [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.
86-
- [avoid-positive-tabindex](docs/rules/avoid-positive-tabindex.md): Enforce tabIndex value is not greater than zero.
87-
- [onclick-has-focus](docs/rules/onclick-has-focus.md): Enforce that elements with onClick handlers must be focusable.
88-
89-
## Contributing
90-
Feel free to contribute! I am currently using [Google Chrome's Audit Rules](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules) to map out as rules for this plugin.
85+
- [use-onblur-not-onchange](docs/rules/use-onblur-not-onchange.md): Enforce that `onBlur` is used instead of `onChange`.
86+
- [valid-aria-proptype](docs/rules/valid-aria-proptype.md): Enforce ARIA state and property values are valid.
87+
- [valid-aria-role](docs/rules/valid-aria-role.md): Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
9188

9289
## License
9390

0 commit comments

Comments
 (0)