File tree Expand file tree Collapse file tree 6 files changed +10
-14
lines changed Expand file tree Collapse file tree 6 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ module.exports = {
36
36
create : context => ( {
37
37
JSXAttribute : ( attribute ) => {
38
38
const name = propName ( attribute ) ;
39
- const normalizedName = name ? name . toLowerCase ( ) : '' ;
39
+ const normalizedName = name . toLowerCase ( ) ;
40
40
41
41
// `aria` needs to be prefix of property.
42
42
if ( normalizedName . indexOf ( 'aria-' ) !== 0 ) {
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ module.exports = {
63
63
create : context => ( {
64
64
JSXAttribute : ( attribute ) => {
65
65
const name = propName ( attribute ) ;
66
- const normalizedName = name ? name . toLowerCase ( ) : '' ;
66
+ const normalizedName = name . toLowerCase ( ) ;
67
67
68
68
// Not a valid aria-* state or property.
69
69
if ( normalizedName . indexOf ( 'aria-' ) !== 0 || aria . get ( normalizedName ) === undefined ) {
Original file line number Diff line number Diff line change @@ -41,10 +41,9 @@ module.exports = {
41
41
}
42
42
43
43
// Get prop name
44
- const name = propName ( attribute ) ;
45
- const normalizedName = name ? name . toUpperCase ( ) : '' ;
44
+ const name = propName ( attribute ) . toUpperCase ( ) ;
46
45
47
- if ( normalizedName !== 'ROLE' ) { return ; }
46
+ if ( name !== 'ROLE' ) { return ; }
48
47
49
48
const value = getLiteralPropValue ( attribute ) ;
50
49
Original file line number Diff line number Diff line change @@ -47,10 +47,9 @@ module.exports = {
47
47
return ;
48
48
}
49
49
50
- const name = propName ( prop ) ;
51
- const normalizedName = name ? name . toLowerCase ( ) : '' ;
50
+ const name = propName ( prop ) . toLowerCase ( ) ;
52
51
53
- if ( invalidAttributes . indexOf ( normalizedName ) > - 1 ) {
52
+ if ( invalidAttributes . indexOf ( name ) > - 1 ) {
54
53
context . report ( {
55
54
node,
56
55
message : errorMessage ( name ) ,
Original file line number Diff line number Diff line change @@ -26,10 +26,9 @@ module.exports = {
26
26
27
27
create : context => ( {
28
28
JSXAttribute : ( attribute ) => {
29
- const name = propName ( attribute ) ;
30
- const normalizedName = name ? name . toLowerCase ( ) : '' ;
29
+ const name = propName ( attribute ) . toLowerCase ( ) ;
31
30
32
- if ( normalizedName !== 'role' ) {
31
+ if ( name !== 'role' ) {
33
32
return ;
34
33
}
35
34
Original file line number Diff line number Diff line change @@ -22,11 +22,10 @@ module.exports = {
22
22
23
23
create : context => ( {
24
24
JSXAttribute : ( attribute ) => {
25
- const name = propName ( attribute ) ;
26
- const normalizedName = name ? name . toUpperCase ( ) : '' ;
25
+ const name = propName ( attribute ) . toUpperCase ( ) ;
27
26
28
27
// Check if tabIndex is the attribute
29
- if ( normalizedName !== 'TABINDEX' ) {
28
+ if ( name !== 'TABINDEX' ) {
30
29
return ;
31
30
}
32
31
You can’t perform that action at this time.
0 commit comments