Socket
Socket
Sign inDemoInstall

eslint-plugin-jsx-a11y

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jsx-a11y - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

11

lib/rules/valid-aria-role.js

@@ -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 },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc