edx-custom-a11y-rules
Advanced tools
Comparing version
@@ -14,2 +14,19 @@ var customRules = { | ||
{ | ||
'id': 'valid-ids', | ||
'selector': '[id^="0"],[id^="1"],[id^="2"],[id^="3"],[id^="4"],[id^="5"],[id^="6"],[id^="7"],' + | ||
'[id^="8"],[id^="9"]', | ||
'enabled': true, | ||
'tags': [ 'edx-custom' ], | ||
'all': [], | ||
'any': [], | ||
'none': [ | ||
'invalid-id-extant' | ||
], | ||
'metadata': { | ||
'description': 'Ensures element ids do not start with a number.', | ||
'help': 'Element ids MUST not start with a number.', | ||
'helpUrl': 'https://openedx.atlassian.net/wiki/display/A11Y/edX+Specific+Accessibility+Tests' | ||
} | ||
}, | ||
{ | ||
'id': 'nav-aria-label', | ||
@@ -207,3 +224,3 @@ 'selector': 'nav', | ||
validHeadings = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6']; | ||
if (childNode === 'HEADER' && node.children[0].children.length > 0) { | ||
@@ -228,3 +245,3 @@ childNode = node.children[0].children[0].nodeName; | ||
validElems = ['SPAN']; | ||
if (validElems.indexOf(elem) > -1) { | ||
@@ -236,4 +253,19 @@ return true; | ||
} | ||
}, | ||
{ | ||
'id': 'invalid-id-extant', | ||
'metadata': { | ||
'impact': 'critical', | ||
'messages': { | ||
'pass': 'element ids must not start with a number', | ||
'fail': 'element ids must not start with a number' | ||
}, | ||
}, | ||
evaluate: function(node, options) { | ||
var nodeName = node.nodeName, | ||
validElems = ['IFRAME']; | ||
return (validElems.indexOf(nodeName) === -1); | ||
} | ||
} | ||
] | ||
}; |
{ | ||
"name": "edx-custom-a11y-rules", | ||
"version": "0.1.3", | ||
"version": "1.0.0", | ||
"description": "Custom rules for accessibility testing with aXe Core", | ||
@@ -5,0 +5,0 @@ "main": "", |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
99169
4.76%681
4.93%0
-100%101
8.6%