bfsg-scanner 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,20 @@ follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.0] - 2026-10-19
10
+
11
+ ### Fixed
12
+
13
+ - The default `wcagTags` left out `wcag21a`, the Level A criteria WCAG 2.1
14
+ added, so a default run never checked SC 2.5.3 *Label in Name* (EN 301 549
15
+ clause 9.2.5.3, rule `label-content-name-mismatch`, enabled since axe-core
16
+ 4.14). The default is now `wcag2a`, `wcag2aa`, `wcag21a`, `wcag21aa`. See
17
+ ADR 0013. ([#65](https://github.com/MihaelaAghirculesei/bfsg-scanner/issues/65))
18
+
19
+ **This can fail a CI gate that passed on 0.3.0:** a default run can now
20
+ report SC 2.5.3 violations it did not report before. To keep the old rule
21
+ set for now, list `wcag2a`, `wcag2aa`, `wcag21aa` in `wcagTags`.
22
+
9
23
  ## [0.3.0] - 2026-10-17
10
24
 
11
25
  ### Added
@@ -106,7 +120,8 @@ First release.
106
120
  - Distributable package: a `bfsg-scanner` bin and a `dist` build that
107
121
  excludes tests.
108
122
 
109
- [Unreleased]: https://github.com/MihaelaAghirculesei/bfsg-scanner/compare/v0.3.0...HEAD
123
+ [Unreleased]: https://github.com/MihaelaAghirculesei/bfsg-scanner/compare/v0.4.0...HEAD
124
+ [0.4.0]: https://github.com/MihaelaAghirculesei/bfsg-scanner/compare/v0.3.0...v0.4.0
110
125
  [0.3.0]: https://github.com/MihaelaAghirculesei/bfsg-scanner/compare/v0.2.2...v0.3.0
111
126
  [0.2.2]: https://github.com/MihaelaAghirculesei/bfsg-scanner/compare/v0.2.1...v0.2.2
112
127
  [0.2.1]: https://github.com/MihaelaAghirculesei/bfsg-scanner/compare/v0.2.0...v0.2.1
package/README.md CHANGED
@@ -134,6 +134,7 @@ settleMs: 0 # pause after load before the scan (see below)
134
134
  wcagTags: # axe rule sets to run
135
135
  - wcag2a
136
136
  - wcag2aa
137
+ - wcag21a
137
138
  - wcag21aa
138
139
  excludePaths: [] # URL-path globs to skip while crawling
139
140
  outputDir: reports # where the report files are written
@@ -17,7 +17,7 @@ export const configSchema = z.strictObject({
17
17
  sitemapOrigin: originSchema.optional(),
18
18
  maxPages: z.number().int().positive().max(1000).default(50),
19
19
  settleMs: z.number().int().min(0).max(60_000).default(0),
20
- wcagTags: z.array(wcagTagSchema).min(1).default(['wcag2a', 'wcag2aa', 'wcag21aa']),
20
+ wcagTags: z.array(wcagTagSchema).min(1).default(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']),
21
21
  excludePaths: z.array(z.string()).default([]),
22
22
  outputDir: z.string().min(1).default('reports'),
23
23
  failOn: failOnSchema.default('serious'),
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAElF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAEjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAElE;;;;GAIG;AACH,MAAM,YAAY,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CACjC,CAAC,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MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAC7F,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC/C,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC;IACvC,cAAc,EAAE,oBAAoB,CAAC,OAAO,CAAC,IAAI,CAAC;IAClD,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;CACnF,CAAC,CAAC"}
@@ -2,8 +2,8 @@
2
2
  * A WCAG SC tag: `wcag` followed by the digits of the criterion number with
3
3
  * the dots removed — `wcag143` is SC 1.4.3, `wcag1410` is SC 1.4.10. The
4
4
  * first two digits are always the principle and guideline; whatever follows
5
- * is the criterion. Level tags (`wcag2a`, `wcag2aa`, `wcag21aa`) carry
6
- * letters after `wcag` and so never match.
5
+ * is the criterion. Level tags (`wcag2a`, `wcag2aa`, `wcag21a`, `wcag21aa`)
6
+ * carry letters after `wcag` and so never match.
7
7
  */
8
8
  const WCAG_SC_TAG = /^wcag(\d)(\d)(\d+)$/;
9
9
  /**
@@ -0,0 +1,53 @@
1
+ # 13. Default WCAG rule set
2
+
3
+ Date: 2026-10-19
4
+
5
+ ## Status
6
+
7
+ Accepted
8
+
9
+ ## Context
10
+
11
+ axe-core selects rules by tag. A WCAG version and level is one tag, and
12
+ each tag holds only the criteria that version added at that level:
13
+ `wcag2a` and `wcag2aa` are WCAG 2.0, `wcag21a` and `wcag21aa` are what
14
+ WCAG 2.1 added. A WCAG 2.1 AA check needs all four.
15
+
16
+ The default `wcagTags` were `wcag2a`, `wcag2aa`, `wcag21aa`. No decision
17
+ left out `wcag21a`; it was an oversight. Up to axe-core 4.13 it cost
18
+ nothing, because the one rule tagged `wcag21a` and not also tagged by the
19
+ others, `label-content-name-mismatch` (SC 2.5.3 *Label in Name*), was
20
+ `experimental` and did not run. axe-core 4.14, which 0.3.0 ships, enables
21
+ it, so a default run that the README and the report call WCAG 2.1 AA
22
+ skipped a criterion EN 301 549 clause 9.2.5.3 requires (#65).
23
+
24
+ ## Decision
25
+
26
+ **The default rule set is the WCAG 2.1 Level A and AA tags, all four:**
27
+ `wcag2a`, `wcag2aa`, `wcag21a`, `wcag21aa`.
28
+
29
+ That is the level EN 301 549 V3.2.1 chapter 9 references, and with it the
30
+ BFSG presumption of conformity (ADR 0004). The default follows the standard,
31
+ not the tags that happen to have rules today, so a rule axe-core adds under
32
+ any of the four runs without a change here.
33
+
34
+ Not in the default:
35
+
36
+ - **`wcag2aaa`**: Level AAA is not required by EN 301 549.
37
+ - **`wcag22a` / `wcag22aa`**: WCAG 2.2 is not yet what EN 301 549
38
+ references. A later EN 301 549 that moves to WCAG 2.2 calls for a new
39
+ decision and a minor release.
40
+ - **`best-practice`, `experimental`**: not WCAG criteria, so their findings
41
+ could not cite a clause and would blur what a failing gate means.
42
+
43
+ A config can still narrow the set; `wcagTagSchema` accepts any subset.
44
+
45
+ ## Consequences
46
+
47
+ - A default run can report findings that 0.3.0 did not, so a CI gate that
48
+ passed on 0.3.0 can fail on the same site. The change ships in a minor
49
+ release with a CHANGELOG note.
50
+ - Any later change to the default rule set changes what a gate checks and
51
+ is released the same way: a minor, never a patch.
52
+ - The golden fixture site covers SC 2.5.3 (`fixtures/site/label-in-name.html`),
53
+ so dropping `wcag21a` again fails the test suite.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bfsg-scanner",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "WCAG 2.1 AA / BFSG compliance scanner built on Playwright and axe-core",
5
5
  "keywords": [
6
6
  "accessibility",