1.5.1 • Published 5 months ago

ay11lint v1.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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 1
    • warning: Both warnings and errors trigger exit code 1
    • info: 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

1.5.1

5 months ago

1.5.0

5 months ago

1.4.0

5 months ago

1.3.0

5 months ago

1.2.0

5 months ago

1.1.0

5 months ago

1.0.0

5 months ago