Socket
Book a DemoInstallSign in
Socket

@sa11y/format

Package Overview
Dependencies
Maintainers
4
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sa11y/format

Accessibility results re-formatter

7.4.0
latest
Source
npmnpm
Version published
Maintainers
4
Created
Source

@sa11y/format

Format accessibility results from axe

  • Usage

Usage

Basic Formatting

import axe from 'axe-core';
import { A11yError } from '@sa11y/format';

const results = await axe.run();
console.log(A11yError.checkAndThrow(results.violations));

Exception List Filtering

Filter out specific accessibility violations based on rule ID and CSS selectors:

import { exceptionListFilter, exceptionListFilterSelectorKeywords } from '@sa11y/format';

// Filter by rule ID and specific CSS selectors
const exceptionList = {
    'color-contrast': ['.btn-secondary', '.text-muted'],
    'landmark-one-main': ['body'],
};
const filteredResults = exceptionListFilter(violations, exceptionList);

// Filter by selector keywords
const keywords = ['known-issue', 'legacy-component'];
const keywordFilteredResults = exceptionListFilterSelectorKeywords(violations, keywords);

Result Processing

Process and enhance accessibility results with WCAG metadata:

import { A11yResult, appendWcag } from '@sa11y/format';

// Process individual result
const processedResult = new A11yResult(violationData);

// Add WCAG metadata to results
const resultsWithWcag = appendWcag(violations);

Keywords

accessibility

FAQs

Package last updated on 20 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.