Update checked-in dependencies
This commit is contained in:
parent
601c5ba56e
commit
eff6331393
1778 changed files with 42517 additions and 154082 deletions
10
node_modules/eslint-plugin-github/lib/utils/get-role.js
generated
vendored
10
node_modules/eslint-plugin-github/lib/utils/get-role.js
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
const {getProp, getPropValue} = require('jsx-ast-utils')
|
||||
const {getProp, getLiteralPropValue} = require('jsx-ast-utils')
|
||||
const {elementRoles} = require('aria-query')
|
||||
const {getElementType} = require('./get-element-type')
|
||||
const ObjectMap = require('./object-map')
|
||||
|
|
@ -43,7 +43,7 @@ function cleanElementRolesMap() {
|
|||
*/
|
||||
function getRole(context, node) {
|
||||
// Early return if role is explicitly set
|
||||
const explicitRole = getPropValue(getProp(node.attributes, 'role'))
|
||||
const explicitRole = getLiteralPropValue(getProp(node.attributes, 'role'))
|
||||
if (explicitRole) {
|
||||
return explicitRole
|
||||
}
|
||||
|
|
@ -80,8 +80,8 @@ function getRole(context, node) {
|
|||
continue
|
||||
}
|
||||
|
||||
const value = getPropValue(propOnNode)
|
||||
if (value || (value === '' && prop === 'alt')) {
|
||||
const value = getLiteralPropValue(propOnNode)
|
||||
if (propOnNode) {
|
||||
if (
|
||||
prop === 'href' ||
|
||||
prop === 'aria-labelledby' ||
|
||||
|
|
@ -90,7 +90,7 @@ function getRole(context, node) {
|
|||
(prop === 'alt' && value !== '')
|
||||
) {
|
||||
key.attributes.push({name: prop, constraints: ['set']})
|
||||
} else {
|
||||
} else if (value || (value === '' && prop === 'alt')) {
|
||||
key.attributes.push({name: prop, value})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue