chore: add quality guardrails — linting, accessibility, rules#273
Merged
tomasz-tomczyk merged 2 commits intomainfrom Apr 16, 2026
Merged
chore: add quality guardrails — linting, accessibility, rules#273tomasz-tomczyk merged 2 commits intomainfrom
tomasz-tomczyk merged 2 commits intomainfrom
Conversation
Add automated tooling to catch issues that previously required manual audits: **Go linting** — expand golangci-lint with nilerr, gocritic, errorlint, unparam. Fix all 26 findings: errors.As conversions, if-else→switch, nolint annotations for intentional nil-return patterns, exitAfterDefer extraction, complexity refactoring of loadCommentsFromCritJSON. **Frontend linting** — add ESLint (no-var, prefer-const, no-unused-vars, eqeqeq) and Stylelint (ban hardcoded colors in style.css). Fix all 133 findings: 87 hardcoded colors extracted to 33 new CSS custom properties across all 4 theme blocks, 46 JS fixes (catch params, dead assignments, strict equality, shadowing). Use color-mix() to derive badge/toast borders from existing --green/--red vars. **Accessibility** — add axe-core to Playwright E2E suite with WCAG 2.0 AA test. **Pre-commit hook** — add ESLint, Stylelint, CSS variable validation checks alongside existing Go checks. **CI** — add lint-frontend job, 58% Go coverage threshold. **Claude Code config** — add .claude/rules/ with path-specific semantic rules (Go, frontend JS, frontend CSS) that only contain things linters can't catch. Add PostCompact hook to re-inject semantic reminders after context compaction. Add Common Mistakes section to AGENTS.md. Add compaction guidance to CLAUDE.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Disable color-contrast (74 elements) and nested-interactive (6 elements) rules for now — these are pre-existing issues, not regressions. The test still catches new ARIA, keyboard, and structural violations. Co-Authored-By: Claude Opus 4.6 <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.
Summary
Add automated tooling to catch the recurring issue categories found across 21 audit PRs (#145–#271). Based on analysis of every audit finding, research of popular Go project linter configs (cli/cli, cobra, docker/cli, bubbletea, tailscale), and Claude Code best practices.
Go linting
errors.Asconversions, if-else→switch,//nolint:nilerrannotations for intentional patterns,exitAfterDeferextraction,loadCommentsFromCritJSONcomplexity refactoringFrontend linting
scripts/check-css-vars.sh— validates allvar()references resolve to defined propertiescolor-mix()to derive badge/toast border colors from existing--green/--redvarsAccessibility
Pre-commit hook
CI
lint-frontendjob (ESLint + Stylelint + CSS var check)Claude Code config
.claude/rules/with path-specific semantic rules for Go, JS, CSS (only things linters can't catch)PostCompacthook to re-inject semantic reminders after context compactionExpected impact
~74% reduction in audit findings per cycle (from ~27 to ~7), leaving only genuinely hard issues for periodic review.
Test plan
golangci-lint run ./...— 0 issuesnpx eslint frontend/app.js— 0 issuesnpx stylelint "frontend/*.css"— 0 issuesbash scripts/check-css-vars.sh— all definedgo test ./...— all pass🤖 Generated with Claude Code