@fringetools/cli 0.1.2 → 0.1.4
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/dist/bin.js
CHANGED
|
@@ -4,7 +4,7 @@ import { readFileSync as readFileSync8 } from "fs";
|
|
|
4
4
|
import { resolve } from "path";
|
|
5
5
|
|
|
6
6
|
// src/version.ts
|
|
7
|
-
var VERSION = "0.1.
|
|
7
|
+
var VERSION = "0.1.4";
|
|
8
8
|
|
|
9
9
|
// src/check.ts
|
|
10
10
|
import { readFileSync as readFileSync5 } from "fs";
|
|
@@ -293,7 +293,11 @@ var fr206 = {
|
|
|
293
293
|
severity: "error",
|
|
294
294
|
check: (ctx) => {
|
|
295
295
|
const out = [];
|
|
296
|
-
|
|
296
|
+
const isBackdrop = (i) => {
|
|
297
|
+
const next = ctx.elems[i + 1], me = ctx.elems[i];
|
|
298
|
+
return !!next && next.parentTag === me.tag && next.loc.line >= me.loc.line && (/^(alert)?dialog$/.test(next.attrs.role ?? "") || next.attrs["aria-modal"] === "true");
|
|
299
|
+
};
|
|
300
|
+
for (const e of ctx.elems.filter((el, i) => ["div", "span"].includes(el.tag) && (el.attrs.onClick ?? el.attrs.onclick) !== void 0 && el.attrs.role === void 0 && (el.attrs.tabIndex ?? el.attrs.tabindex) === void 0 && !isBackdrop(i))) {
|
|
297
301
|
out.push({ rule: "FR-206", severity: "error", message: `onClick on non-interactive <${e.tag}>`, hint: `use a <button>/<a> or add role and tabIndex`, loc: e.loc, wcag: "2.1.1" });
|
|
298
302
|
}
|
|
299
303
|
return out;
|
package/dist/index.js
CHANGED