How to use the axe-core/package.json.version function in axe-core

To help you get started, we’ve selected a few axe-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webhintio / hint / packages / hint-axe / scripts / create.js View on Github external
const main = async () => {
    const axePath = require.resolve('axe-core').replace(/axe.js$/, '');
    const axePackage = require('axe-core/package.json');
    const rulePaths = await globby(`${axePath.replace(/\\/g, '/')}lib/rules/*.json`);

    const rules = rulePaths.map((rulePath) => {
        return /** @type {RuleMeta} */ (require(rulePath));
    }).sort((r1, r2) => {
        return r1.id.localeCompare(r2.id);
    });

    const categories = [...new Set(getCategories(rules))].sort();

    createConfig(categories);
    createDocs(categories, rules, axePackage.version);
    createHints(categories, rules);
    createLocales(categories);
    createMetas(categories, rules);
};

axe-core

Accessibility engine for automated Web UI testing

MPL-2.0
Latest version published 29 days ago

Package Health Score

100 / 100
Full package analysis