@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
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "./chunk-E3SJZ4OQ.js";
4
+ } from "./chunk-WXASOIWD.js";
5
5
 
6
6
  // src/bin.ts
7
7
  process.exitCode = await runCli(process.argv.slice(2));
@@ -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.2";
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
- for (const e of ctx.elems.filter((el) => ["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)) {
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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runCli
3
- } from "./chunk-E3SJZ4OQ.js";
3
+ } from "./chunk-WXASOIWD.js";
4
4
  export {
5
5
  runCli
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fringetools/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {