ay11lint
v1.5.2
Published
An accessibility linter for HTML files with a focus on WCAG compliance, based on axe-core
Downloads
93
Maintainers
Readme
ay11lint
An accessibility linter for HTML files with a focus on WCAG compliance based on axe.
Installation
npm install ay11lint
Usage
ay11lint <file-or-directory-path>
Configuration
Create an ay11lint.json or .ay11lintrc file in your project root:
{
"lintingSrouceFolder": "dist", // folder to lint, after using your templating engine to compile into html
"ignore": ["node_modules/**"], // glob patterns to ignore
"extensions": [".njk", ".html"], // file extensions to lint
"rules": {
"link-name": { "enabled": false },
"region": { "enabled": true }
}, // rule configuration based on axe-core rules configuration
"rulesMessages": {
"link-name": "Link name should be a sentence",
"region": "Region should be a sentence"
}, // custom messages for rules
"severity": "error" | "warning" | "info"
}
The severity field in your configuration determines which issue levels will cause the linter to fail (exit code 1). Higher severity levels include all lower levels.
info > warning > error
Features
- WCAG 2.0 compliance checking
- WCAG 2.1 compliance checking
- HTML accessibility validation
- Support for single files and directories
- Configurable rules and extensions
- Configurable severity levels with hierarchical behavior:
error
: Only error-level issues trigger exit code 1warning
: Both warnings and errors trigger exit code 1info
: All issues (info, warnings, and errors) trigger exit code 1
Contributing
Contributions are welcome! Please read our contributing guidelines before submitting a pull request.
License
This project is licensed under the MIT License. MIT © HC