Skip to content

Commit 20fca67

Browse files
committed
Change rule name for uses-label-for to label-uses-for to follow convention.
1 parent c6c59fc commit 20fca67

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Then configure the rules you want to use under the rules section.
7171
- [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.
7272
- [use-onblur-not-onchange](docs/rules/use-onblur-not-onchange.md): Enforce that onBlur is used instead of onChange.
7373
- [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.
74-
- [use-label-for](docs/rules/use-label-for.md): Enforce that label elements have the htmlFor attribute
74+
- [label-uses-for](docs/rules/label-uses-for.md): Enforce that label elements have the htmlFor attribute
7575
- [redundant-alt](docs/rules/redundant-alt.md): Enforce img alt attribute does not contain the word image, picture, or photo.
7676
- [no-hash-href](docs/rules/no-hash-href.md): Enforce an anchor element's href prop value is not just #.
7777

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# use-label-for
1+
# label-uses-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/use-label-for": [ 2, "Label" ], // OR
40-
"jsx-a11y/use-label-for": [ 2, [ "Label", "InputDescriptor" ] ]
39+
"jsx-a11y/label-uses-for": [ 2, "Label" ], // OR
40+
"jsx-a11y/label-uses-for": [ 2, [ "Label", "InputDescriptor" ] ]
4141
}
4242
}
4343
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-jsx-a11y",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "A static analysis linter of jsx and their accessibility with screen readers.",
55
"keywords": [
66
"eslint",

src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ module.exports = {
88
'mouse-events-map-to-key-events': require('./rules/mouse-events-map-to-key-events'),
99
'use-onblur-not-onchange': require('./rules/use-onblur-not-onchange'),
1010
'no-access-key': require('./rules/no-access-key'),
11-
'use-label-for': require('./rules/use-label-for'),
12-
'no-hash-href': require('./rules/no-hash-href')
11+
'label-uses-for': require('./rules/label-uses-for'),
12+
'no-hash-href': require('./rules/no-hash-href'),
13+
'table-uses-caption': require('./rules/table-uses-caption')
1314
},
1415
configs: {
1516
recommended: {
@@ -25,7 +26,7 @@ module.exports = {
2526
"jsx-a11y/mouse-events-map-to-key-events": 2,
2627
"jsx-a11y/use-onblur-not-onchange": 2,
2728
"jsx-a11y/no-access-key": 2,
28-
"jsx-a11y/use-label-for": 2,
29+
"jsx-a11y/label-uses-for": 2,
2930
"jsx-a11y/no-hash-href": 2
3031
}
3132
}
File renamed without changes.

tests/src/rules/use-label-for.js renamed to tests/src/rules/label-uses-for.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Requirements
1010
// -----------------------------------------------------------------------------
1111

12-
import rule from '../../../src/rules/use-label-for';
12+
import rule from '../../../src/rules/label-uses-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('use-label-for', rule, {
37+
ruleTester.run('label-uses-for', rule, {
3838
valid: [
3939
// DEFAULT ELEMENT 'label' TESTS
4040
{ code: '<label htmlFor="foo" />', parserOptions },

0 commit comments

Comments
 (0)