ci: add lint and typecheck workflow (closes #147)#369
Open
Aymericr wants to merge 2 commits into
Open
Conversation
- Remove stale biome-ignore suppressions in bootstrap.ts, r3f.d.ts, and parametric-node-renderer.tsx (rules no longer fire). - Replace forEach callbacks that return values with for...of loops in node-actions.ts and build-collider-world.ts (lint/suspicious/useIterableCallbackReturn). - Rewrite assign-in-expression guards in ceiling/tool.tsx to explicit if-statements (lint/suspicious/noAssignInExpressions). - Hoist useMemo/useCallback above early return in chimney/panel.tsx (lint/correctness/useHookAtTopLevel). - Add `^build` to turbo check-types dependsOn so packages/core dist is up-to-date before type checking — this resolves all 32 type errors which were caused by stale dist, not missing symbols.
Adds a quality gate that runs `bun run check` (Biome) and `bun run check-types` (TypeScript) on every push and PR to main. Uses concurrency groups to cancel stale runs. Closes #147.
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.
Adds the CI workflow contributors have been asking for, and resolves the lint/typecheck blockers that were preventing it from being added cleanly.
Closes #147.
What's in the workflow
.github/workflows/ci.ymlrunsbun run check(Biome lint + format) andbun run check-types(TypeScript) on every push and PR tomain. Concurrency groups cancel stale runs.What had to be cleaned up first
bun run checkhad 4 lint errors andbun run check-typeshad 32 errors onmain— merging the workflow without fixing those would have blocked every subsequent push.Lint (4 errors → 0):
biome-ignorecomments inbootstrap.ts,r3f.d.ts, andparametric-node-renderer.tsx— the rules they were suppressing no longer fire in those positions, so the suppressions themselves were the lint errors (suppressions/unused).forEachcallbacks that returned values withfor...ofloops (node-actions.ts,build-collider-world.ts) — fixesuseIterableCallbackReturn.x && (x.foo = false)short-circuit-assignment guards inceiling/tool.tsxas explicitifstatements — fixesnoAssignInExpressions.useMemo/useCallbackpair above an earlyreturn nullinchimney/panel.tsx— fixesuseHookAtTopLevel.Types (32 errors → 0):
The 32 type errors all reproduce on a fresh checkout but disappear once
packages/coreis built — the symbols (useAlignmentGuides,AlignmentAnchor,bboxAnchors,resolveAlignment,TranslateHandle,ParamAction,GutterNode, plus the various missing handle/event properties andPaintableMaterialTargetvariants) all exist inpackages/core/src/and are re-exported through the package barrels. The publisheddist/was just stale, and consumers resolve types viadist(per the package'sexportsfield withmoduleResolution: "bundler").The fix is a single
turbo.jsonchange:check-typesnowdependsOn: ["^build", "^check-types"]so internal builds run before type-checks. No@ts-ignore, noas any, no consumer code changes needed.Verification
bun run check— 0 errors, 0 warnings (101 non-blockinguseExhaustiveDependenciesinfos remain atinfolevel per existing config — those don't fail CI).bun run check-types— 0 errors across all 9 typed projects.Out of scope
useExhaustiveDependenciesinfos inviewer/index.tsx,door-system.tsx,geometry-system.tsx,window-system.tsx, etc. — they're warnings/infos not errors, and fixing them properly needs more familiarity with each component than this PR should take on.packages/mcpalready has its ownmcp-ci.ymlworkflow with build + test + biome on path-filtered changes; this new general workflow runs alongside it.