Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-jsx-a11y

Package Overview
Dependencies
Maintainers
2
Versions
84
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 1.2.2 to 1.2.3

lib/util/getTabIndex.js

5

CHANGELOG.md

@@ -0,1 +1,6 @@

1.2.3 / 2016-06-02
==================
- [fix] Handle dynamic tabIndex expression values, but still retain validation logic for literal tabIndex values.
1.2.2 / 2016-05-20

@@ -2,0 +7,0 @@ ==================

2

docs/rules/onclick-has-focus.md

@@ -32,3 +32,3 @@ # onclick-has-focus

<!-- Good: buttons are inherently focusable -->
<button onClick="doSomething();">Click the button :)</a>
<button onClick="doSomething();">Click the button :)</button>
```

@@ -35,0 +35,0 @@

@@ -23,5 +23,5 @@ /**

var _getAttributeValue = require('../util/getAttributeValue');
var _getTabIndex = require('../util/getTabIndex');
var _getAttributeValue2 = _interopRequireDefault(_getAttributeValue);
var _getTabIndex2 = _interopRequireDefault(_getTabIndex);

@@ -51,3 +51,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

return;
} else if (!isNaN(Number((0, _getAttributeValue2.default)((0, _getAttribute2.default)(attributes, 'tabIndex'))))) {
} else if ((0, _getTabIndex2.default)((0, _getAttribute2.default)(attributes, 'tabIndex')) !== undefined) {
return;

@@ -54,0 +54,0 @@ }

@@ -15,2 +15,6 @@ 'use strict';

var _getTabIndex = require('./getTabIndex');
var _getTabIndex2 = _interopRequireDefault(_getTabIndex);
var _DOM = require('./attributes/DOM');

@@ -26,4 +30,4 @@

var href = (0, _getAttributeValue2.default)((0, _getAttribute2.default)(attributes, 'href'));
var tabIndex = (0, _getAttributeValue2.default)((0, _getAttribute2.default)(attributes, 'tabIndex'));
return Boolean(href) || !isNaN(Number(tabIndex));
var tabIndex = (0, _getTabIndex2.default)((0, _getAttribute2.default)(attributes, 'tabIndex'));
return href !== undefined || tabIndex !== undefined;
},

@@ -30,0 +34,0 @@ // This is same as `a` interactivity function

{
"name": "eslint-plugin-jsx-a11y",
"version": "1.2.2",
"version": "1.2.3",
"description": "A static analysis linter of jsx and their accessibility with screen readers.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -11,3 +11,3 @@ /**

import getNodeType from '../util/getNodeType';
import getAttributeValue from '../util/getAttributeValue';
import getTabIndex from '../util/getTabIndex';

@@ -35,3 +35,3 @@ // ----------------------------------------------------------------------------

return;
} else if (!isNaN(Number(getAttributeValue(getAttribute(attributes, 'tabIndex'))))) {
} else if (getTabIndex(getAttribute(attributes, 'tabIndex')) !== undefined) {
return;

@@ -38,0 +38,0 @@ }

@@ -5,2 +5,3 @@ 'use strict';

import getAttributeValue, { getLiteralAttributeValue } from './getAttributeValue';
import getTabIndex from './getTabIndex';
import DOMElements from './attributes/DOM';

@@ -14,4 +15,4 @@

const href = getAttributeValue(getAttribute(attributes, 'href'));
const tabIndex = getAttributeValue(getAttribute(attributes, 'tabIndex'));
return Boolean(href) || !isNaN(Number(tabIndex));
const tabIndex = getTabIndex(getAttribute(attributes, 'tabIndex'));
return href !== undefined || tabIndex !== undefined;
},

@@ -18,0 +19,0 @@ // This is same as `a` interactivity function

@@ -57,2 +57,3 @@ /**

{ code: '<a tabIndex="0" onClick={() => void 0} />', parserOptions },
{ code: '<a tabIndex={dynamicTabIndex} onClick={() => void 0} />', parserOptions },
{ code: '<a tabIndex={0} onClick={() => void 0} />', parserOptions },

@@ -59,0 +60,0 @@ { code: '<a role="button" href="#" onClick={() => void 0} />', 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