Skip to content

Commit da3be73

Browse files
committed
Rename rules and reorganize documentation. (jsx-eslint#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

+14-14
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 docs/rules/aria-props.md

+1-1
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 docs/rules/aria-proptypes.md

+1-1
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 docs/rules/aria-role.md

+1-1
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 docs/rules/aria-unsupported-elements.md

+1-1
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 docs/rules/href-no-hash.md

+3-3
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 docs/rules/img-has-alt.md

+3-3
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 docs/rules/img-redundant-alt.md

+1-1
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 docs/rules/label-has-for.md

+3-3
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 docs/rules/mouse-events-have-key-events.md

+1-1
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

docs/rules/use-onblur-not-onchange.md docs/rules/no-onchange.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# use-onblur-not-onchange
1+
# no-onchange
22

33
Enforce usage of `onBlur` over/in parallel with `onChange` for accessibility. `onBlur` **should** be used instead of `onChange`, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users. `onBlur` is a more declarative action by the user: for instance in a dropdown, using the arrow keys to toggle between options will trigger the `onChange` event in some browsers. Regardless, when a change of context results from an `onBlur` event or an `onChange` event, the user should be notified of the change unless it occurs below the currently focused element.
44

docs/rules/onclick-uses-role.md docs/rules/onclick-has-role.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# onclick-uses-role
1+
# onclick-has-role
22

33
Enforce visible, non-interactive elements with click handlers use role attribute. Visible means that it is not hidden from a screen reader. Examples of non-interactive elements are `div`, `section`, and `a` elements without a href prop. The purpose of the role attribute is to identify to screenreaders the exact function of an element.
44

docs/rules/role-requires-aria.md docs/rules/role-has-required-aria-props.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# role-requires-aria
1+
# role-has-required-aria-props
22

33
Elements with ARIA roles must have all required attributes for that role.
44

docs/rules/aria-role-supports-attribute.md docs/rules/role-supports-aria-props.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# aria-role-supports-attribute
1+
# role-supports-aria-props
22

33
Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. Many ARIA attributes (states and properties) can only be used on elements with particular roles. Some elements have implicit roles, such as `<a href="#" />`, which will resolve to `role="link"`.
44

docs/rules/avoid-positive-tabindex.md docs/rules/tabindex-no-positive.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# avoid-positive-tabindex
1+
# tabindex-no-positive
22

33
Avoid positive tabIndex property values to synchronize the flow of the page with keyboard tab order.
44

src/index.js

+29-27
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
module.exports = {
44
rules: {
5-
'img-uses-alt': require('./rules/img-uses-alt'),
6-
'redundant-alt': require('./rules/redundant-alt'),
7-
'onclick-uses-role': require('./rules/onclick-uses-role'),
8-
'mouse-events-map-to-key-events': require('./rules/mouse-events-map-to-key-events'),
9-
'use-onblur-not-onchange': require('./rules/use-onblur-not-onchange'),
5+
'aria-props': require('./rules/aria-props'),
6+
'aria-proptypes': require('./rules/aria-proptypes'),
7+
'aria-role': require('./rules/aria-role'),
8+
'aria-unsupported-elements': require('./rules/aria-unsupported-elements'),
9+
'href-no-hash': require('./rules/href-no-hash'),
10+
'img-has-alt': require('./rules/img-has-alt'),
11+
'img-redundant-alt': require('./rules/img-redundant-alt'),
12+
'label-has-for': require('./rules/label-has-for'),
13+
'mouse-events-have-key-events': require('./rules/mouse-events-have-key-events'),
1014
'no-access-key': require('./rules/no-access-key'),
11-
'label-uses-for': require('./rules/label-uses-for'),
12-
'no-hash-href': require('./rules/no-hash-href'),
13-
'valid-aria-role': require('./rules/valid-aria-role'),
14-
'valid-aria-proptypes': require('./rules/valid-aria-proptypes'),
15-
'no-invalid-aria': require('./rules/no-invalid-aria'),
16-
'role-requires-aria': require('./rules/role-requires-aria'),
17-
'no-unsupported-elements-use-aria': require('./rules/no-unsupported-elements-use-aria'),
18-
'avoid-positive-tabindex': require('./rules/avoid-positive-tabindex'),
15+
'no-onchange': require('./rules/no-onchange'),
1916
'onclick-has-focus': require('./rules/onclick-has-focus'),
20-
'aria-role-supports-attribute': require('./rules/aria-role-supports-attribute')
17+
'onclick-has-role': require('./rules/onclick-has-role'),
18+
'role-has-required-aria-props': require('./rules/role-has-required-aria-props'),
19+
'role-supports-aria-props': require('./rules/role-supports-aria-props'),
20+
'tabindex-no-positive': require('./rules/tabindex-no-positive')
2121
},
2222
configs: {
2323
recommended: {
@@ -27,20 +27,22 @@ module.exports = {
2727
}
2828
},
2929
rules: {
30-
'jsx-a11y/img-uses-alt': 2,
31-
'jsx-a11y/redundant-alt': 2,
32-
'jsx-a11y/onclick-uses-role': 2,
33-
'jsx-a11y/mouse-events-map-to-key-events': 2,
34-
'jsx-a11y/use-onblur-not-onchange': 2,
30+
'jsx-a11y/aria-props': 2,
31+
'jsx-a11y/aria-proptypes': 2,
32+
'jsx-a11y/aria-role': 2,
33+
'jsx-a11y/aria-unsupported-elements': 2,
34+
'jsx-a11y/href-no-hash': 2,
35+
'jsx-a11y/img-has-alt': 2,
36+
'jsx-a11y/img-redundant-alt': 2,
37+
'jsx-a11y/label-has-for': 2,
38+
'jsx-a11y/mouse-events-have-key-events': 2,
3539
'jsx-a11y/no-access-key': 2,
36-
'jsx-a11y/label-uses-for': 2,
37-
'jsx-a11y/no-hash-href': 2,
38-
'jsx-a11y/valid-aria-role': 2,
39-
'jsx-a11y/valid-aria-proptypes': 2,
40-
'jsx-a11y/no-invalid-aria': 2,
41-
'jsx-a11y/role-requires-aria': 2,
42-
'jsx-a11y/no-unsupported-elements-use-aria': 2,
43-
'jsx-a11y/avoid-positive-tabindex': 2
40+
'jsx-a11y/no-onchange': 2,
41+
'jsx-a11y/onclick-hs-focus': 2,
42+
'jsx-a11y/onclick-has-role': 2,
43+
'jsx-a11y/role-has-required-aria-props': 2,
44+
'jsx-a11y/role-supports-aria-props': 2,
45+
'jsx-a11y/tabindex-no-positive': 2
4446
}
4547
}
4648
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/src/rules/no-invalid-aria.js tests/src/rules/aria-props.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Requirements
1010
// -----------------------------------------------------------------------------
1111

12-
import rule from '../../../src/rules/no-invalid-aria';
12+
import rule from '../../../src/rules/aria-props';
1313
import { RuleTester } from 'eslint';
1414

1515
const parserOptions = {
@@ -38,7 +38,7 @@ const basicValidityTests = Object.keys(ariaAttributes).map(prop => ({
3838
parserOptions
3939
}));
4040

41-
ruleTester.run('no-invalid-aria', rule, {
41+
ruleTester.run('aria-props', rule, {
4242
valid: [
4343
// Variables should pass, as we are only testing literals.
4444
{ code: '<div />', parserOptions },

tests/src/rules/valid-aria-proptypes.js tests/src/rules/aria-proptypes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Requirements
1010
// -----------------------------------------------------------------------------
1111

12-
import rule from '../../../src/rules/valid-aria-proptypes';
12+
import rule from '../../../src/rules/aria-proptypes';
1313
import { RuleTester } from 'eslint';
1414

1515
const parserOptions = {
@@ -46,7 +46,7 @@ const errorMessage = name => {
4646
}
4747
};
4848

49-
ruleTester.run('valid-aria-proptypes', rule, {
49+
ruleTester.run('aria-proptypes', rule, {
5050
valid: [
5151
// DON'T TEST INVALID ARIA-* PROPS
5252
{ code: '<div aria-foo="true" />', parserOptions },

tests/src/rules/valid-aria-role.js tests/src/rules/aria-role.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Requirements
1010
// -----------------------------------------------------------------------------
1111

12-
import rule from '../../../src/rules/valid-aria-role';
12+
import rule from '../../../src/rules/aria-role';
1313
import { RuleTester } from 'eslint';
1414

1515
const parserOptions = {
@@ -46,7 +46,7 @@ const invalidTests = createTests(invalidRoles).map(test => {
4646
return test;
4747
});
4848

49-
ruleTester.run('valid-aria-role', rule, {
49+
ruleTester.run('aria-role', rule, {
5050
valid: [
5151
// Variables should pass, as we are only testing literals.
5252
{ code: '<div />', parserOptions },

tests/src/rules/no-unsupported-elements-use-aria.js tests/src/rules/aria-unsupported-elements.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Requirements
1010
// -----------------------------------------------------------------------------
1111

12-
import rule from '../../../src/rules/no-unsupported-elements-use-aria';
12+
import rule from '../../../src/rules/aria-unsupported-elements';
1313
import { RuleTester } from 'eslint';
1414

1515
const parserOptions = {
@@ -70,7 +70,7 @@ const invalidAriaValidityTests = Object.keys(DOM)
7070
parserOptions
7171
}));
7272

73-
ruleTester.run('no-unsupported-elements-use-aria', rule, {
73+
ruleTester.run('aria-unsupported-elements', rule, {
7474
valid: roleValidityTests.concat(ariaValidityTests),
7575
invalid: invalidRoleValidityTests.concat(invalidAriaValidityTests)
7676
});

tests/src/rules/no-hash-href.js tests/src/rules/href-no-hash.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Requirements
1010
// -----------------------------------------------------------------------------
1111

12-
import rule from '../../../src/rules/no-hash-href';
12+
import rule from '../../../src/rules/href-no-hash';
1313
import { RuleTester } from 'eslint';
1414

1515
const parserOptions = {
@@ -33,7 +33,7 @@ const expectedError = {
3333
const string = [ 'Link' ];
3434
const array = [ [ 'Anchor', 'Link' ] ];
3535

36-
ruleTester.run('no-hash-href', rule, {
36+
ruleTester.run('href-no-hash', rule, {
3737
valid: [
3838
// DEFAULT ELEMENT 'a' TESTS
3939
{ code: '<a />;', parserOptions },

tests/src/rules/img-uses-alt.js tests/src/rules/img-has-alt.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Requirements
1010
// -----------------------------------------------------------------------------
1111

12-
import rule from '../../../src/rules/img-uses-alt';
12+
import rule from '../../../src/rules/img-has-alt';
1313
import { RuleTester } from 'eslint';
1414

1515
const parserOptions = {
@@ -39,7 +39,7 @@ const string = [ 'Avatar' ];
3939
const array = [ [ 'Thumbnail', 'Image' ] ];
4040

4141

42-
ruleTester.run('img-uses-alt', rule, {
42+
ruleTester.run('img-has-alt', rule, {
4343
valid: [
4444
// DEFAULT ELEMENT 'img' TESTS
4545
{ code: '<img alt="foo" />;', parserOptions },

tests/src/rules/redundant-alt.js tests/src/rules/img-redundant-alt.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Requirements
1010
// -----------------------------------------------------------------------------
1111

12-
import rule from '../../../src/rules/redundant-alt';
12+
import rule from '../../../src/rules/img-redundant-alt';
1313
import { RuleTester } from 'eslint';
1414

1515
const parserOptions = {
@@ -31,7 +31,7 @@ const expectedError = {
3131
type: 'JSXOpeningElement'
3232
};
3333

34-
ruleTester.run('redundant-alt', rule, {
34+
ruleTester.run('img-redundant-alt', rule, {
3535
valid: [
3636
{ code: '<img alt="foo" />;', parserOptions },
3737
{ code: '<img alt="picture of me taking a photo of an image" aria-hidden />', parserOptions },

tests/src/rules/label-uses-for.js tests/src/rules/label-has-for.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Requirements
1010
// -----------------------------------------------------------------------------
1111

12-
import rule from '../../../src/rules/label-uses-for';
12+
import rule from '../../../src/rules/label-has-for';
1313
import { RuleTester } from 'eslint';
1414

1515
const parserOptions = {
@@ -34,7 +34,7 @@ const expectedError = {
3434
const string = [ 'Label' ];
3535
const array = [ [ 'Label', 'Descriptor' ] ];
3636

37-
ruleTester.run('label-uses-for', rule, {
37+
ruleTester.run('label-has-for', rule, {
3838
valid: [
3939
// DEFAULT ELEMENT 'label' TESTS
4040
{ code: '<label htmlFor="foo" />', parserOptions },

tests/src/rules/mouse-events-map-to-key-events.js tests/src/rules/mouse-events-have-key-events.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Requirements
1111
// -----------------------------------------------------------------------------
1212

13-
import rule from '../../../src/rules/mouse-events-map-to-key-events';
13+
import rule from '../../../src/rules/mouse-events-have-key-events';
1414
import { RuleTester } from 'eslint';
1515

1616
const parserOptions = {
@@ -35,7 +35,7 @@ const mouseOutError = {
3535
type: 'JSXOpeningElement'
3636
};
3737

38-
ruleTester.run('mouse-events-map-to-key-events', rule, {
38+
ruleTester.run('mouse-events-have-key-events', rule, {
3939
valid: [
4040
{ code: '<div onMouseOver={() => void 0} onFocus={() => void 0} />;', parserOptions },
4141
{ code: '<div onMouseOver={() => void 0} onFocus={() => void 0} {...props} />;', parserOptions },

0 commit comments

Comments
 (0)