fix(tooling): make pnpm lint and pnpm typecheck cover what precommit covers - #956
Closed
chughtapan wants to merge 1 commit into
Closed
fix(tooling): make pnpm lint and pnpm typecheck cover what precommit covers#956chughtapan wants to merge 1 commit into
chughtapan wants to merge 1 commit into
Conversation
…covers `lint:sloppy-code-guard` hung off `precommit` rather than `lint`, and the root `typecheck` script stopped at `typecheck`, so neither top-level command saw the Effect-hygiene guards or any type error in a test file. Both gaps only surfaced at commit time, after the checks had already reported green. The root scripts also restated the `workspace:lint` dependency graph as a shell chain, which is how the two drifted apart in the first place. They now delegate, and `workspace:typecheck` states the full set of type surfaces once. `oxlint` joins the existing `ignoreDependencies` entries for tools invoked from nx targets instead of package scripts, alongside typedoc and mermaid-cli. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P76aaa1STr3WPZ3nDascta
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.
Found while implementing the harness stack: I reported "typecheck 0 errors, lint 0 errors" on work that the pre-commit hook then rejected — twice. The commands were not lying so much as under-scoped.
The two gaps
lint:sloppy-code-guardhung offprecommit, notlint. Sopnpm lintnever ran the Effect-hygiene guards. This is not redundant with eslint: for anasyncin production source carrying aneslint-disablecomment, eslint reports only a warning (unused directive) while the guard reports [FAIL]. That exact case shipped pastpnpm lintin #955 and was caught only at commit time.pnpm typecheckstopped at thetypechecktarget. Test files are covered by a separatetypecheck:teststarget, so seven type errors in test files passed a cleanpnpm typecheckin #954 before the hook caught them.Root cause of the drift
The root
package.jsonscripts restated theworkspace:lintdependency graph as a shell&&chain. Two definitions of the same thing, so adding a check to one silently left the other behind. That is why the guard ended up attached toprecommit— it was the only place someone remembered to wire it.The fix
lint:sloppy-code-guardmoves intoworkspace:lint'sdependsOn.checkandprecommitboth depend onlint, so they inherit it — and its now-redundant direct listing inprecommitis removed.workspace:typechecktarget states every type surface once: build, per-packagetypecheck, the two v2 packages, andtypecheck:tests.lintandtypecheckscripts delegate to those targets instead of restating them.oxlintjoinsignoreDependenciesinknip.json. It is still invoked, byworkspace:lint:oxlint; knip reads package scripts and cannot see nx targets. This follows the existing entries fortypedocand@mermaid-js/mermaid-cli, which are there for the same reason.Non-vacuity
Both gates were verified to catch what they previously missed, not merely to pass:
asyncin production source with an eslint-disablesloppy-code-guard:[FAIL] [async-keyword], 1 violationconst x: number = "str"inprofile.test.tstypecheck's scopetypecheck:tests:error TS2322: Type 'string' is not assignable to type 'number'Both probes were reverted; the working tree is clean.
nx show project workspaceconfirmslint→lint:sloppy-code-guardandtypecheck→typecheck:testsare in the graphs.pnpm nx run workspace:precommitexits 0 on the result.ADR conformance (R-pass)
CONFORMS(vacuously)docs/decisions/README.mdonmain(49 records). No accepted outcome governs build tooling or task wiring. The diff changes no wire contract, public interface, trust boundary, or persistence — the categories ADRs here govern.Stated rather than left silent, per the R-pass rule that "no ADR governs this" is itself a reviewable claim.
🤖 Generated with Claude Code
https://claude.ai/code/session_01P76aaa1STr3WPZ3nDascta