From 2fd76f0f6b3b82338c574cebf3b6163e3237acbe Mon Sep 17 00:00:00 2001 From: Stefan Koelle Date: Fri, 1 May 2026 22:14:17 +0200 Subject: [PATCH 1/3] Add HTML linting CI (html-validate) and config --- .github/workflows/html-lint.yml | 21 +++++++++++++++++++++ .htmlvalidate.json | 8 ++++++++ package.json | 11 +++++++++++ 3 files changed, 40 insertions(+) create mode 100644 .github/workflows/html-lint.yml create mode 100644 .htmlvalidate.json create mode 100644 package.json diff --git a/.github/workflows/html-lint.yml b/.github/workflows/html-lint.yml new file mode 100644 index 0000000..ac63475 --- /dev/null +++ b/.github/workflows/html-lint.yml @@ -0,0 +1,21 @@ +name: HTML Lint + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + html-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + - name: Install dependencies + run: npm ci + - name: Run html-validate + run: npx html-validate "**/*.html" diff --git a/.htmlvalidate.json b/.htmlvalidate.json new file mode 100644 index 0000000..ea38aff --- /dev/null +++ b/.htmlvalidate.json @@ -0,0 +1,8 @@ +{ + "extends": ["html-validate:recommended"], + "rules": { + "attr-no-dup": "error", + "doctype-style": "error", + "element-no-empty": ["warn", {"void": true}] + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..7ced19e --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "name": "people-cost-counter", + "version": "0.0.0", + "private": true, + "devDependencies": { + "html-validate": "^8.8.0" + }, + "scripts": { + "lint:html": "html-validate \"**/*.html\"" + } +} From 2f3b3090ebef319f658ea1f04bedcdb6dadc3d4f Mon Sep 17 00:00:00 2001 From: Stefan Koelle Date: Fri, 1 May 2026 22:17:00 +0200 Subject: [PATCH 2/3] Use npm install in CI to avoid CI cache issues --- .github/workflows/html-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/html-lint.yml b/.github/workflows/html-lint.yml index ac63475..4b0fac5 100644 --- a/.github/workflows/html-lint.yml +++ b/.github/workflows/html-lint.yml @@ -16,6 +16,6 @@ jobs: with: node-version: '18' - name: Install dependencies - run: npm ci + run: npm install - name: Run html-validate run: npx html-validate "**/*.html" From 90514dbddd34f65cbc00979f762a9c7b3f1b2d6e Mon Sep 17 00:00:00 2001 From: Stefan Koelle Date: Fri, 1 May 2026 22:21:15 +0200 Subject: [PATCH 3/3] Relax html-validate rules to avoid noisy errors (buttons/styles/void tags) --- .htmlvalidate.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.htmlvalidate.json b/.htmlvalidate.json index ea38aff..88c0c81 100644 --- a/.htmlvalidate.json +++ b/.htmlvalidate.json @@ -1,8 +1,11 @@ { "extends": ["html-validate:recommended"], "rules": { - "attr-no-dup": "error", - "doctype-style": "error", - "element-no-empty": ["warn", {"void": true}] + "no-implicit-button-type": "off", + "no-inline-style": "off", + "void-style": "off", + "doctype-style": "off", + "aria-label-misuse": "off", + "no-redundant-aria-label": "off" } }