@accesslint/cli 0.2.0 → 0.2.1
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/cli.js +5 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7745,6 +7745,10 @@ function Gn(e2) {
|
|
|
7745
7745
|
var jn = new Map(Ze.map((e2) => [e2.id, e2]));
|
|
7746
7746
|
|
|
7747
7747
|
// src/audit.ts
|
|
7748
|
+
function isHTMLFragment(html) {
|
|
7749
|
+
const prefix = html.slice(0, 1000);
|
|
7750
|
+
return !(/<!doctype\s/i.test(prefix) || /<html[\s>]/i.test(prefix));
|
|
7751
|
+
}
|
|
7748
7752
|
var globalsRegistered = false;
|
|
7749
7753
|
function ensureGlobals(window) {
|
|
7750
7754
|
if (globalsRegistered)
|
|
@@ -7852,11 +7856,6 @@ var main = defineCommand({
|
|
|
7852
7856
|
description: "Include AAA-level rules",
|
|
7853
7857
|
default: false
|
|
7854
7858
|
},
|
|
7855
|
-
"component-mode": {
|
|
7856
|
-
type: "boolean",
|
|
7857
|
-
description: "Exclude page-level rules",
|
|
7858
|
-
default: false
|
|
7859
|
-
},
|
|
7860
7859
|
disable: {
|
|
7861
7860
|
type: "string",
|
|
7862
7861
|
alias: "d",
|
|
@@ -7869,7 +7868,7 @@ var main = defineCommand({
|
|
|
7869
7868
|
const disabledRules = args.disable ? args.disable.split(",").map((s2) => s2.trim()) : undefined;
|
|
7870
7869
|
const result = audit(html, {
|
|
7871
7870
|
includeAAA: args["include-aaa"],
|
|
7872
|
-
componentMode:
|
|
7871
|
+
componentMode: isHTMLFragment(html),
|
|
7873
7872
|
disabledRules
|
|
7874
7873
|
});
|
|
7875
7874
|
console.log(format(result, args.format));
|