Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
};