accesslint-core

0.2.1 • Public • Published

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.

Package Sidebar

Install

npm i accesslint-core

Weekly Downloads

1

Version

0.2.1

License

ISC

Unpacked Size

9.49 kB

Total Files

4

Last publish

Collaborators

  • accesslint-owner
  • ckundo
  • tysongach