accesslint-core
v0.2.1
Published
Scan HTML content for common accessibility errors.
Downloads
4
Readme
AccessLint Core
A node module and CLI to scan HTML content for common accessibility issues.
Usage
Import
npm install accesslint-core
import scan from "accesslint-core";
scan("<img src='' />").catch(issues => console.log(issues));
CLI / bin command
$ accesslint --html "<img src='' />"
Outputs to stdout:
[
{
"location": {
"startLine": 1,
"startCol": 1,
"startOffset": 0,
"endLine": 1,
"endCol": 15,
"endOffset": 14,
"attrs": {
"src": {
"startLine": 1,
"startCol": 6,
"startOffset": 5,
"endLine": 1,
"endCol": 12,
"endOffset": 11
}
},
"startTag": {
"startLine": 1,
"startCol": 1,
"startOffset": 0,
"endLine": 1,
"endCol": 15,
"endOffset": 14,
"attrs": {
"src": {
"startLine": 1,
"startCol": 6,
"startOffset": 5,
"endLine": 1,
"endCol": 12,
"endOffset": 11
}
}
}
},
"type": "image-alt"
}
]
Rules
- Blank labels for form elements.
- Missing text alternatives for images.
- Valid
aria
attributes. - Correct
tabindex
values.