ci: add lint & checks workflow for pull requests#2
Merged
Conversation
Small, zero-footprint CI (no package.json / lockfile committed; tools are fetched on the fly) that runs on PRs and pushes to main: - HTML lint via htmlhint (.github/linters/.htmlhintrc) - ESLint over the standalone scripts AND the inline <script> blocks in each world (eslint-plugin-html). High-signal rules only — no style enforcement, so the exhibits' intentionally dense code passes while real mistakes (undef refs, dupe keys, assignment-in-condition, bad typeof, unreachable code) are caught. - Internal link & asset check: every href/src/<meta> image in the HTML must resolve to a real file, with exact case (GitHub Pages is case-sensitive). Ignores script/style so JS-built URLs aren't flagged. - Service-worker version guard (PRs only): fails if a cached CORE file changed but VERSION in service-worker.js wasn't bumped — the exact stale-cache trap DEPLOY.md warns about. All steps use if: always() so a PR surfaces every failure at once. Verified locally against the current tree: all four checks pass, and negative probes confirm each check actually catches its target. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A small, zero-footprint CI for pull requests (and pushes to
main). Nopackage.json/lockfile is committed — linters are fetched on the fly, configs live under.github/so the repo root stays clean.Checks (
.github/workflows/ci.yml).js+ inline<script>viaeslint-plugin-html)typeof, unreachable codehref/src/<meta>image must resolve to a real file — with exact case (Pages is case-sensitive)VERSIONinservice-worker.jswasn't bumped → the stale-cache trapDEPLOY.mdwarns aboutESLint is deliberately rule-light: it enforces no style, so the exhibits' intentionally dense vanilla JS passes — it only flags real bugs. All steps use
if: always()so a PR surfaces every failure at once.Decisions worth a sanity-check
npx/npm install --no-save, nothing committed. Trade-off — versions live in the workflow, not lockfile-reproducible. A.gitignorekeepsnode_modules/package-lock.jsonout if you lint locally.@v4tags (not SHAs) — fine for a personal site; can SHA-pin if you prefer.Verification (locally, before pushing)
<script>; link check flags a missing path and a wrong-casefavicon.SVG; the SW guard fails on a CORE edit without a bump.