Skip to content

Phase 3 - Essential Tooling & Quality Gates

Done

  • Track: Both (MVP & Showcase)
  • Duration: 1 day
  • Dependencies: Phase 0-2 completed
  • Deliverables: Linting setup, formatting config, CI pipeline, quality gates
  • TypeScript configured
  • Design system initialized
  • Git repository set up
  • Package manager chosen
StepTaskMVPShowcaseNotes
3.01Install BiomeReplaces ESLint + Prettier
3.02Configure Biome rulesAstro-friendly settings
3.03Set up format commandFormat on save
3.04Configure lint commandType-aware linting
3.05Set up pre-commit hookHusky + lint-staged
3.06Set up commit-msg hookHusky + commitlint
3.07Create CI workflowGitHub Actions
3.08Add type checkingtsc + astro check
3.09Configure build checksToken validation (script to check all semantic color token pairs for WCAG AA contrast)
3.10Set up branch protectionRequire CI pass
3.11Add dependency auditSecurity scanning
3.12Set up unit testing for utilitiesVitest for core helpers/utils
3.13Create quality reports (e.g., coverage)Broader test coverage, complexity reports
3.14Document standardsContributing guide

This project uses Biome as its primary tool for code formatting and linting, replacing the more traditional combination of ESLint and Prettier. Here’s why:

  • Performance: Biome is written in Rust and is designed to be extremely fast—often over 20x faster than ESLint. This keeps the development feedback loop quick, especially in large codebases.
  • Simplicity: By combining formatting and linting into a single tool, Biome reduces configuration overhead. There’s only one configuration file (biome.json) and one dependency to manage.
  • All-in-One Solution: Biome handles formatting, linting, and import sorting out of the box, eliminating the need for separate plugins and tools to make them work together.
  • First-Class TypeScript Support: It’s built with TypeScript in mind, providing robust and accurate type-aware linting.

Our pre-commit hooks will automatically:

  • Format your code with Biome
  • Sort Tailwind classes
  • Validate TypeScript types

Run all quality checks:

Terminal window
pnpm run quality

Note: As the project grows, the full pnpm run quality suite (including tests, extensive linting, etc.) might become slower. For faster local iteration, a mechanism such as setting an environment variable (e.g., CI=0 or FAST_LINT=true) might be implemented to run a quicker, focused subset of these checks. However, the complete quality suite will always be enforced by pre-commit hooks and the CI pipeline to ensure no regressions.

Individual checks:

  • pnpm run lint - Check for code issues
  • pnpm run format:check - Verify formatting
  • pnpm run check - Type checking
  • Use TypeScript strict mode
  • Prefer const over let
  • Use optional chaining (?.)
  • Sort imports alphabetically
  • Keep files under 300 lines
  • One component per file
  • Props interface exported
  • JSDoc comments for public APIs
  • Accessibility considered
  1. Create feature branch

  2. Make changes

  3. Commit with conventional format:

    • feat: New features
    • fix: Bug fixes
    • docs: Documentation
    • style: Formatting
    • refactor: Code restructuring
    • perf: Performance
    • test: Testing
    • chore: Maintenance
  4. Push and create PR

  5. Ensure CI passes

Respect our performance budgets:

  • JS Bundle: < 160KB
  • CSS Bundle: < 50KB
  • Images: < 200KB each
  • WCAG AA compliance minimum
  • Test with keyboard navigation
  • Verify with screen readers
  • Check color contrast
  1. Conflicting Formatters: Having Prettier and Biome both active

    • Solution: Disable Prettier, use only Biome
  2. Slow CI: Running unnecessary checks

    • Solution: Parallelize jobs, cache dependencies
  3. Token Drift: Forgetting to commit built tokens

    • Solution: CI validates token builds
  4. Type Errors Hidden: Not running strict checks

    • Solution: Both tsc and astro check in CI
  • Biome installed and configured
  • Format/lint commands working
  • Pre-commit hooks functional
  • CI pipeline passing
  • Type checking enabled
  • Token validation in CI
  • Branch protection enabled
  • Security scanning active
  • VSCode settings configured
  • Contributing guide written

If tooling causes issues:

  1. Biome Problems:

    Terminal window
    # Temporarily disable
    mv biome.json biome.json.backup
    # Use basic prettier config
    echo '{"semi": true}' > .prettierrc
  2. CI Failures:

    - Check for flaky tests
    - Increase timeouts if needed
    - Review recent dependency updates
  3. Hook Issues:

    Terminal window
    # Bypass hooks temporarily
    git commit --no-verify
    # Fix and re-enable
  • biome.json - Linting and formatting rules
  • .github/workflows/ci.yml - CI pipeline
  • package.json - Scripts and hooks
  • .vscode/settings.json - Editor config
  • “Set up Biome for Astro project”
  • “Create GitHub Actions CI for quality checks”
  • “Configure pre-commit hooks with Husky”
  • “Add security scanning to CI”
  • Team size and experience
  • CI/CD platform (GitHub Actions, etc.)
  • Performance requirements
  • Security compliance needs