eslint-plugin-jsx-a11y
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -60,10 +60,9 @@ /** | ||
// If value is a literal. | ||
var normalizedValue = attribute.value.value.toUpperCase(); | ||
var isValid = _validRoleTypes2.default.indexOf(normalizedValue) > -1; | ||
var normalizedValues = attribute.value.value.toUpperCase().split(" "); | ||
var isValid = normalizedValues.every(function (value) { | ||
return _validRoleTypes2.default.indexOf(value) > -1; | ||
}); | ||
if (isValid === false) { | ||
context.report({ | ||
node: attribute, | ||
message: errorMessage | ||
}); | ||
report(context, attribute); | ||
} | ||
@@ -70,0 +69,0 @@ } |
{ | ||
"name": "eslint-plugin-jsx-a11y", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "A static analysis linter of jsx and their accessibility with screen readers.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -50,10 +50,7 @@ /** | ||
// If value is a literal. | ||
const normalizedValue = attribute.value.value.toUpperCase(); | ||
const isValid = validRoleTypes.indexOf(normalizedValue) > -1; | ||
const normalizedValues = attribute.value.value.toUpperCase().split(" "); | ||
const isValid = normalizedValues.every(value => validRoleTypes.indexOf(value) > -1); | ||
if (isValid === false) { | ||
context.report({ | ||
node: attribute, | ||
message: errorMessage | ||
}); | ||
report(context, attribute); | ||
} | ||
@@ -60,0 +57,0 @@ } |
@@ -49,2 +49,3 @@ /** | ||
{ code: '<div role={role || "foobar"} />', parserOptions }, | ||
{ code: '<div role="tabpanel row" />', parserOptions }, | ||
{ code: '<Bar baz />', parserOptions } | ||
@@ -57,2 +58,4 @@ ].concat(basicValidityTests), | ||
{ code: '<div role=""></div>', errors: [ errorMessage ], parserOptions }, | ||
{ code: '<div role="tabpanel row foobar"></div>', errors: [ errorMessage ], parserOptions }, | ||
{ code: '<div role="tabpanel row range"></div>', errors: [ errorMessage ], parserOptions }, | ||
{ code: '<div role={undefined}></div>', errors: [ errorMessage ], parserOptions }, | ||
@@ -59,0 +62,0 @@ { code: '<div role />', errors: [ errorMessage ], parserOptions }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97970
1957