Skip to content

refactor: effect/avoid-untagged-errors to zero - #610

Merged
thomasfosterau merged 1 commit into
trunkfrom
lint-avoid-untagged-errors
Nov 12, 2026
Merged

thomasfosterau merged 1 commit into
trunkfrom
lint-avoid-untagged-errors

Conversation

@thomasfosterau

Copy link
Copy Markdown
Owner

Summary

Part of #533. effect/avoid-untagged-errors goes from 62 sites to 0 and its warn line is deleted from vite.config.ts; the inline oxlint-disable-next-line in src/Query.ts is gone because that site is fixed.

  • Construction-time programmer errors in src/ (Resource, Include, Relationship, Query, Endpoint, Handlers, Lid, Registry, ApiError, internal/operators, internal/schemaExt) still throw synchronously at the same moment with the same message text. They now throw an internal DeclarationError, a branded Schema.TaggedError in the new src/internal/errors.ts, built through declarationError(message). It is not exported, so no new public API.
  • Query.ts messageOf and the blog example use Predicate.isError instead of instanceof Error.
  • The blog example's thrown errors become a local tagged InvalidOperation.
  • Tests: "expected X" guards become assert(...) from vite-plus/test. Stand-in causes become a per-file branded Boom tagged error.
  • test/entry-points.test.ts lists internal/errors.ts in the schema tier (it imports only effect/Schema).

Site counts: effect/avoid-untagged-errors 62 -> 0. Total vp lint diagnostics 4055 -> 3993, with no other rule's count up (every other rule unchanged).

Verification

  • pnpm install --frozen-lockfile: pass
  • vp run build: pass
  • vp check: pass
  • vp run check: pass
  • vp run -r test:unit: pass
  • vp run docgen: pass
  • vp run test:coverage: pass; vp exec fallow audit --base origin/trunk: verdict pass

Changeset

  • .changeset/declaration-error.md (patch): thrown declaration errors keep their messages and instanceof Error, but are now DeclarationError with name/_tag "DeclarationError" instead of a bare Error. No class is exported.

Notes

No exported signatures or declaration-emit shape change. Runtime-visible only through the thrown value's name/_tag.


Generated by Claude Code

Part of #533.

Co-Authored-By: Claude Sonnet 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: b71426d

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 Patch

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

@thomasfosterau
thomasfosterau merged commit c4a253a into trunk Nov 12, 2026
5 checks passed
@thomasfosterau
thomasfosterau deleted the lint-avoid-untagged-errors branch November 12, 2026 05:57
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