Thanks for considering a contribution. This project is small and deliberately dependency-light; the guidelines below exist to keep it that way.
git clone https://github.com/css-scroll-driven/scroll-a11y-audit.git
cd scroll-a11y-audit
npm install
npm testYou need Node 20 or newer and a local Chrome or Chromium if you want to run the
CLI. npm test needs neither Chrome nor a network connection.
puppeteer-coreis the only runtime dependency. Please do not add another one. There is no test framework (node --test), no bundler (a hand-written concat script) and no linter config to satisfy — just match the surrounding style.- Rules must stay environment-agnostic. A rule receives
(ctx, model)and must never touch a global. Reaching fordocumentorwindowdirectly breaks the browser build, the CLI and the tests all at once. - Every top-level identifier must be globally unique across
src/. The browser build concatenates the sources and will fail loudly on a collision — this is intentional, not a bug to work around. - Every rule needs tests in both directions: a fixture that triggers it and a fixture that must not. A rule that only has positive tests will get noisy in the field and nobody will notice.
- Create
src/rules/<your-rule-id>.js. Export a uniquely-named rule object withid,title,severity,wcag,description,howToFix,learnMoreandrun. Name the run functionrun<YourRuleId>. - Register it in
src/rules/index.js— import order is report order. - Add the file to
SEGMENTSinscripts/build-browser.mjs, after anything it imports from. - Add tests to
tests/rules.test.mjsusing the helpers intests/helpers/stub-dom.mjs. If the stub lacks something you need, extend the stub rather than working around it in the rule. - Add a row to the rules reference table in
README.md. - Add a triggering case to
demo/bad.htmland the correct pattern todemo/good.html.
Run the full check before opening a pull request:
npm test
node scripts/build-browser.mjs
node --check browser/scroll-a11y-audit.jsFalse positives matter more than missed findings here — a noisy auditor gets
switched off, and then it catches nothing at all. When you report one, please
include the smallest CSS and HTML that reproduces it, the rule id, and what the
correct verdict should be. A failing test case in tests/rules.test.mjs is the
most useful possible bug report.
Write in the imperative mood and explain the reasoning, not just the change: "Stop flagging reduced-motion blocks in animation-blocks-interaction" beats "fix bug".
Contributions are accepted under the MIT Licence.