chore: add slophammer TypeScript constraints#323
Merged
osolmaz merged 8 commits intoMay 18, 2026
Conversation
d0a14b4 to
bfa2e09
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
Author
|
Final verification for this pass:
The full local |
Contributor
Author
|
Final verification for the Slophammer TypeScript gates pass:
This PR is finalized and ready for human review/merge. I did not merge it. |
4b803b5 to
c80dc91
Compare
515957e to
63c15fe
Compare
63c15fe to
63bbce6
Compare
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
The TypeScript library now has enforceable Slophammer-style quality constraints instead of relying only on broad project checks.
This adds policy config, unsafe-type lint rules, mutation testing, dependency-boundary enforcement, and focused tests for the behavior the constraints touch.
The CI Slophammer job uses the published
slophammer-ts@latestpackage throughpnpm dlx, so acpx tracks the current checker without adding Slophammer as a package dependency.What Changed
The change wires Slophammer constraints into the repo in places maintainers can run locally and CI can enforce.
It keeps the existing acpx toolchain and avoids fake ESLint, Prettier, or Vitest declarations just to satisfy checker assumptions.
slophammer.ymlwith TypeScript coverage, complexity, DRY, mutation, and dependency-boundary policy.src/cli/flags.tsand included it inpnpm run checkand CI.src/.src/sessiondepending on queue internals.c8 --allover the current flows/runtime coverage target.slophammer-ts@latest check . --only ts.dependency-boundaries-requireddirectly.AGENTS.md, including the coverage target and current full-check limitation.Testing
The local checks pass on head
63c15fe.A separate code-quality subagent reviewed the PR for shortcuts; its dependency-boundary finding was fixed, the temporary local Slophammer report filter was removed after
slophammer-ts@0.1.2added direct rule selection, and the coverage scope limitation is explicit.pnpm run checkpassed.pnpm run check:docspassed.pnpm run test:coveragepassed with94.92statements,87.53branches,96.25functions, and94.92lines for the configured coverage target.pnpm run mutatepassed with mutation score91.07against threshold80.pnpm dlx slophammer-ts@latest rules --format textpassed.pnpm dlx slophammer-ts@latest dry .passed with0DRY candidates.pnpm dlx slophammer-ts@latest check . --only ts.dependency-boundaries-requiredpassed with no findings.I also measured a whole-source
c8 --allgate at 85/85/85/85. The current repo is not there yet across every source file:65.26statements,83.13branches,57.06functions, and65.26lines. This PR does not claim whole-repository 85% coverage.Risks
The main risk is CI runtime because Stryker now runs as part of the normal check job.
The mutation target is intentionally narrow so the added gate stays useful without turning every PR into a long mutation run.