From a3e4729b6cc250b7d6e763ac996f049ab042f1d4 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Thu, 23 Nov 2023 18:40:01 -0800 Subject: [PATCH] Update Webhint configs - More exact browserlist - stop hiding "hint" execution - Disable chromium sandbox since I'm now running it in a container and all content is trusted. - Remove obsolete elements-to-ignore from the compatibility check. - Re-enable the compression check but disable checking for Zopfli compression, which returns a fale-positive; I use efficient-compression-tool for gzip compression which is actually better than Zopfli. - Stop ignoring the "X-Frame-Options" header in no-disallowed-headers, since I stopped sending that header. --- Makefile.online | 5 +++-- linter-configs/browserslistrc | 5 +++-- linter-configs/hintrc | 27 +++++++++++++++------------ 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Makefile.online b/Makefile.online index e9328b3..cbac597 100644 --- a/Makefile.online +++ b/Makefile.online @@ -24,7 +24,7 @@ LIGHTHOUSE_ARGS += --budget-path linter-configs/budget.json --output html --outp hint-online: @echo "Running webhint" - @hint --config linter-configs/hintrc $(URLS) + hint --config linter-configs/hintrc $(URLS) lighthouse: mkdir -p $(CHROME_PROFILE) CHROME_PATH=$(CHROME_PATH) CHROME_PROFILE=$(CHROME_PROFILE) JS_FLAGS='' lighthouse $(URLS) $(LIGHTHOUSE_ARGS) @@ -40,8 +40,9 @@ axe-ff: @echo "Running axe with Firefox" @scripts/bin/axe-ff $(OUTPUT_DIR) $(URLS) + .PHONY: axe axe-ff .PHONY: all-extra -all-extra: axe-ff validate-json equal-access htmlproofer lint-css validate-feeds +all-extra: axe-ff equal-access lint-local diff --git a/linter-configs/browserslistrc b/linter-configs/browserslistrc index 315e679..aee1a91 100644 --- a/linter-configs/browserslistrc +++ b/linter-configs/browserslistrc @@ -7,6 +7,7 @@ > 0.1% last 5 versions -Firefox ESR +Firefox >= 57 +iOS >= 9.1 not dead -IE 9-11 +IE 11 diff --git a/linter-configs/hintrc b/linter-configs/hintrc index 4ad5556..ee85c49 100644 --- a/linter-configs/hintrc +++ b/linter-configs/hintrc @@ -3,7 +3,8 @@ "name": "puppeteer", "options": { "browser": "Chromium", - "headless": true + "headless": true, + "puppeteerOptions": {"args": ["--no-sandbox"]} } }, "extends": [ @@ -43,8 +44,6 @@ "error", { "ignore": [ - "time", - "picture", "a[download]", "a[referrerpolicy]", "a[translate]", @@ -52,7 +51,6 @@ "samp[translate]", "span[translate]", "img[decoding]", - "meta[name=color-scheme]", "meta[name=theme-color]" ] } @@ -64,12 +62,20 @@ "maxAgeTarget": 10800 } ], - "http-compression": "off", + "http-compression": ["error", { + "resource": { + "zopfli": false + }, + "html": { + "zopfli": false + } + }], "https-only": "error", "sri": "error", - "detect-css-reflows": "off", - "detect-css-reflows/layout": "off", - "detect-css-reflows/paint": "off", + "no-http-redirects": "error", + "detect-css-reflows/layout": "hint", + "detect-css-reflows/paint": "hint", + "detect-css-reflows/composite": "hint", "manifest-exists": "error", "manifest-file-extension": "error", "manifest-is-valid": "error", @@ -83,10 +89,7 @@ "no-vulnerable-javascript-libraries": "off", "html-checker": "off", "image-optimization-cloudinary": "off", - "no-disallowed-headers": [ "error", - { - "ignore": ["x-frame-options"] - }], + "no-disallowed-headers": "error", "meta-charset-utf-8": "error", "disown-opener": "error", "content-type": ["error", {