editor icon indicating copy to clipboard operation
editor copied to clipboard

ci: add lint and typecheck workflow on push/PR

Open claygeo opened this issue 7 months ago • 3 comments

Summary

Closes #147

Adds a CI quality gate that catches lint errors and type issues before they hit main. Runs on every push to main and every pull request.

What it runs

Step Command What it checks
Lint & format bun run check Biome lint + format rules from biome.jsonc
Type check bun run check-types tsc --noEmit via turbo across workspaces

Setup

Matches the existing release.yml patterns exactly:

  • oven-sh/setup-bun@v2 for bun
  • actions/setup-node@v4 with Node 22
  • bun install --frozen-lockfile for deterministic installs

Why not PR #192?

That PR uses npm ci but this repo uses bun as its package manager (specified in package.json, with bun.lock committed). This PR uses bun throughout, matching the working setup in release.yml.

Test plan

The workflow will run on this PR itself — check the Actions tab for results.

claygeo avatar Apr 02 '26 18:04 claygeo

CI is working as expected — it caught 7 pre-existing lint errors that have been accumulating on main without a quality gate. All are auto-fixable:

  • 4x useExhaustiveDependencies in floorplan-panel.tsx (missing React hook deps)
  • 1x useExhaustiveDependencies in index.tsx
  • 2x noUnusedImports in floorplan-panel.tsx
  • 1x useImportType in export-system.tsx
  • 2x internalError/fs on CLAUDE.md files (biome trying to lint markdown)

I can fix all of these in a follow-up commit here if you'd like, or they can be addressed separately. The CLAUDE.md errors would go away by adding "*.md" to biome's ignore list or by excluding the .claude/ directory.

Let me know which approach you prefer and I'll update the PR.

claygeo avatar Apr 02 '26 19:04 claygeo

Updated — switched from bun run check (lint + format) to bun run lint (lint only).

The current codebase has pre-existing formatting differences that cause biome check to fail with 191 format violations. Fixing those would require a massive formatting-only PR that touches 189 files. Better to add lint enforcement first and tackle formatting separately.

bun run lint passes cleanly (1 warning, 0 errors). bun run check-types is the other step. CI should be green now.

claygeo avatar Apr 02 '26 19:04 claygeo

Drive-by note: @Aymericr shipped #369 an hour ago which added the lint+typecheck workflow and closed #147. Your PR was actually called out in the issue thread as the most polished approach — particularly the bun run lint vs bun run check call. Sorry it sat. Feel free to close if you'd like; happy to do it for you otherwise.

anton-pascal avatar Jun 06 '26 14:06 anton-pascal