File tree Expand file tree Collapse file tree 4 files changed +8
-28
lines changed Expand file tree Collapse file tree 4 files changed +8
-28
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ module.exports = {
11
11
'label-uses-for' : require ( './rules/label-uses-for' ) ,
12
12
'no-hash-href' : require ( './rules/no-hash-href' ) ,
13
13
'valid-aria-role' : require ( './rules/valid-aria-role' ) ,
14
- 'valid-aria-proptypes' : require ( './rules/valid-aria-proptypes' )
14
+ 'valid-aria-proptypes' : require ( './rules/valid-aria-proptypes' ) ,
15
+ 'no-invalid-aria' : require ( './rules/no-invalid-aria' )
15
16
} ,
16
17
configs : {
17
18
recommended : {
@@ -30,7 +31,8 @@ module.exports = {
30
31
"jsx-a11y/label-uses-for" : 2 ,
31
32
"jsx-a11y/no-hash-href" : 2 ,
32
33
"jsx-a11y/valid-aria-role" : 2 ,
33
- "jsx-a11y/valid-aria-proptypes" : 2
34
+ "jsx-a11y/valid-aria-proptypes" : 2 ,
35
+ "jsx-a11y/no-invalid-aria" : 2
34
36
}
35
37
}
36
38
}
Original file line number Diff line number Diff line change 8
8
// Rule Definition
9
9
// ----------------------------------------------------------------------------
10
10
11
- import validAriaProperties from '../util/validAriaProperties ' ;
11
+ import ariaAttributes from '../util/ariaAttributes ' ;
12
12
13
13
const errorMessage = name => `${ name } : This attribute is an invalid ARIA attribute.` ;
14
14
@@ -22,7 +22,7 @@ module.exports = context => ({
22
22
return ;
23
23
}
24
24
25
- const isValid = validAriaProperties . indexOf ( normalizedName ) > - 1 ;
25
+ const isValid = Object . keys ( ariaAttributes ) . indexOf ( normalizedName ) > - 1 ;
26
26
27
27
if ( isValid === false ) {
28
28
context . report ( {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -30,10 +30,10 @@ const errorMessage = name => ({
30
30
type : 'JSXAttribute'
31
31
} ) ;
32
32
33
- import validAriaProperties from '../../../src/util/validAriaProperties ' ;
33
+ import ariaAttributes from '../../../src/util/ariaAttributes ' ;
34
34
35
35
// Create basic test cases using all valid role types.
36
- const basicValidityTests = validAriaProperties . map ( prop => ( {
36
+ const basicValidityTests = Object . keys ( ariaAttributes ) . map ( prop => ( {
37
37
code : `<div ${ prop . toLowerCase ( ) } ="foobar" />` ,
38
38
parserOptions
39
39
} ) ) ;
You can’t perform that action at this time.
0 commit comments