@github/axe-github
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

axe-github

Custom rules and configuration recommendations for the axe-core library for GitHub projects.

Custom rules

These are the custom rules contained in this package:

  • aria-attribute-is-valid
  • autofocus-in-dialog
  • avoid-both-disabled-and-aria-disabled
  • empty-summary
  • menuitem-should-be-interactive
  • nested-forms
  • redundant-aria-label-aria-labelledby
  • submit-reset-button-must-be-in-form

Configuration

We recommend running axe-core defaults.

Basic usage

import axe from 'axe-core'
import customRules from '@github/axe-github'

axe.configure(customRules)
axe.run(...)

Playwright configuration

For the custom rules in this library, their associated check functions are not serializable to a Playwright page. To configure axe, you'll need to load and evaluate configure-browser.ts within the page context. Axe should be loaded on the page before configuring.

const configSrc = fs.readFileSync(
  require.resolve('@github/axe-github/configure-browser'),
  'utf8'
)

page.evaluate((configSrc) => {
  window.eval(configSrc)
}, configSrc)

/@github/axe-github/

    Package Sidebar

    Install

    npm i @github/axe-github

    Weekly Downloads

    28,378

    Version

    0.7.0

    License

    MIT

    Unpacked Size

    1.45 MB

    Total Files

    10

    Last publish

    Collaborators

    • manuelpuyol
    • jonrohan
    • broccolini
    • primer-css
    • keithamus
    • gracepark
    • jibrangarcia
    • arelia
    • colebemis
    • smockle
    • simurai
    • khiga8
    • dustin.greif
    • srt32
    • githubbot
    • jfuchs
    • andrialexandrou
    • bteng22
    • dustin.savery