Skip to content

lint: effecttsgo/schema-number to zero, at error - #618

Merged
thomasfosterau merged 3 commits into
trunkfrom
lint-schema-number
Nov 12, 2026
Merged

thomasfosterau merged 3 commits into
trunkfrom
lint-schema-number

Conversation

@thomasfosterau

Copy link
Copy Markdown
Owner

Summary

Part of #536. effecttsgo/schema-number goes from 101 sites to 0 and is set to "error" in vite.config.ts, next to the other raised effecttsgo rules. Schema.Number accepts NaN and ±Infinity, so each site now uses the most precise number schema that fits:

  • Schema.Finite for page leaves and general numbers: FlatQuery.ts and Query.ts (including the fromString: false page leaves), the northwind example, the tests and type-level tests, and the doc examples and README snippets.
  • Schema.Int for counts, statuses and indices:
    • the status of ServerErrors.Redirect / HttpError / JsonapiError and of Client.ErrorResponse
    • the numeric path segments of ServerErrors.ValidationFailure
    • ApiError.UnsupportedIncludeDepth.maxDepth
    • Conformance.ContractViolation.remaining

Query parsing over the wire is unchanged: it already decoded through FiniteFromString. Error codes and messages are unchanged, and the conformance tests pass unchanged.

One test changed for a different reason. Resource.filter.test.ts has a "refuses to encode a non-finite number" test, and it needs a schema that admits NaN to reach the encoder's guard. It now builds one explicitly with Schema.make<typeof Schema.Finite>(SchemaAST.number), and a comment says why.

No inline disables and no overrides. Lint went from 3682 to 3581 warnings before the toolchain bump; the only per-rule change was schema-number (101 → 0).

Verification

Run on the tree rebased onto 928131a (#543). The pushed head is a merge whose tree is identical to that one, because the force-push was refused.

  • pnpm install --frozen-lockfile: pass
  • vp run build: pass
  • vp check: pass (0 errors)
  • vp run check: pass
  • vp run -r test:unit: pass
  • vp run docgen: pass
  • vp run test:coverage, then vp exec fallow audit --base origin/trunk: pass (verdict pass)

Changeset

  • .changeset/schema-number-finite.md: minor, Breaking. It lists every published schema whose accepted values narrowed and includes a migration note: pass finite values, and integers for the Schema.Int fields, and annotate as Schema.Finite where code named Schema.Number.

Notes

The emitted .d.ts now names Schema.Finite / Schema.Int where it named Schema.Number.


Generated by Claude Code

Schema.Number becomes Schema.Finite (or Schema.Int for counts and statuses)
across src, examples, tests and docs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY
Takes the tree of the branch rebased onto 928131a (#543).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY
@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 24ee596

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@thomasfosterau/effect-jsonapi Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY

# Conflicts:
#	src/Resource.filter.test.ts
@thomasfosterau
thomasfosterau merged commit 42dc8e1 into trunk Nov 12, 2026
4 checks passed
@thomasfosterau
thomasfosterau deleted the lint-schema-number branch November 12, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants