@sa11y/preset-rules
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -23,3 +23,4 @@ "use strict"; | ||
const priority = priorityEnv && exports.priorities.includes(priorityEnv) ? priorityEnv : ''; | ||
(0, common_1.log)(`Setting Sa11y rules priority to ${priority}`); | ||
if (priority) | ||
(0, common_1.log)(`Setting Sa11y rules priority to ${priority}`); | ||
return priority; | ||
@@ -26,0 +27,0 @@ } |
@@ -17,3 +17,3 @@ import { Priority, WcagLevel, WcagVersion } from './rules'; | ||
/** | ||
* Return formatted string containing WCAG version, level and SC | ||
* Return formatted string containing WCAG SC and Priority | ||
*/ | ||
@@ -20,0 +20,0 @@ toString(): string; |
@@ -24,3 +24,2 @@ "use strict"; | ||
if (ruleInfo) { | ||
// TODO: add tests for codecov | ||
// rule has metadata provided in preset-rules | ||
@@ -33,2 +32,4 @@ this.wcagVersion = rules_1.defaultWcagVersion; | ||
} | ||
// TODO (refactor): Is the following required anymore? | ||
// Cleanup taking the new preset-rules structure into account? | ||
// If rule info metadata doesn't exist (e.g. full ruleset) | ||
@@ -58,8 +59,7 @@ for (const tag of violation.tags.sort()) { | ||
/** | ||
* Return formatted string containing WCAG version, level and SC | ||
* Return formatted string containing WCAG SC and Priority | ||
*/ | ||
toString() { | ||
if (!this.wcagVersion || !this.wcagLevel) | ||
return this.successCriteria; | ||
return `WCAG${this.wcagVersion}-Level${this.wcagLevel}-SC${this.successCriteria}-${this.priority}`; | ||
const SC = this.successCriteria === WcagMetadata.defaultSC ? this.successCriteria : `WCAG-SC${this.successCriteria}`; | ||
return `SA11Y-${SC}-${this.priority}`; | ||
} | ||
@@ -66,0 +66,0 @@ } |
{ | ||
"name": "@sa11y/preset-rules", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Accessibility preset rule configs for axe", | ||
@@ -31,3 +31,3 @@ "license": "BSD-3-Clause", | ||
}, | ||
"gitHead": "87f76e0ddfbccfea1de8edee41642da661b9328a" | ||
"gitHead": "fd5f1566e964e1e1a142ed0fdfdee75d593197d4" | ||
} |
@@ -30,3 +30,3 @@ # `@sa11y/preset-rules` | ||
- `base` contains WCAG 2.1 AA rules available in axe-core. | ||
- `extended` contains WCAG `AAA` rules, experimental rules and non-WCAG best-practice rules. | ||
- `extended` contains WCAG AAA rules, experimental rules and non-WCAG best-practice rules. | ||
- `full` ruleset consists of all rules that are enabled by default in axe. | ||
@@ -33,0 +33,0 @@ - The default ruleset used by the sa11y APIs is `base`. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
65622
494
0