Skip to content

refactor: effect/prefer-namespace-imports on, at error - #594

Merged
thomasfosterau merged 5 commits into
trunkfrom
lint-prefer-namespace-imports
Nov 12, 2026
Merged

thomasfosterau merged 5 commits into
trunkfrom
lint-prefer-namespace-imports

Conversation

@thomasfosterau

Copy link
Copy Markdown
Owner

Summary

Part of #533. Turns effect/prefer-namespace-imports on at error (owner decision, family-wide: use the rule's own aliases) and fixes all 52 sites. PR #590 already moved every effect import to import * as X from "effect/X"; this renames the local aliases.

The rule's alias table (@enfect/oxlint dist/index.js, CANONICAL_ALIASES):

{ Array: "Arr", Predicate: "P", Record: "R", String: "Str", Equal: "Eq", Boolean: "Bool" }

Option and Schema keep their full names.

Changes:

  • Rec -> R (effect/Record), Predicate -> P, Equal -> Eq; src/Group.ts import type { NonEmptyReadonlyArray } from "effect/Array" -> import type * as Arr.
  • Colliding identifiers renamed: resource type parameter R -> Res (Handlers, Query, includeGraph, sparse, Conformance.test), requirements parameter R -> Req (Handlers.IncludeTarget), mapped/infer P -> Prop / Paths / Pay, test locals const R -> res in Resource.filter.test.ts. Type-parameter names are not part of a type's identity, so no published declaration changes meaning.
  • vite.config.ts: removed the off line and its comment; rewrote the no-unsafe-dictionary-type comment (chore: lint no-unsafe-dictionary-type misses sites in files that import effect's Record #275): never bind effect's Record as Record; spelled R, the alias the rule requires.
  • JSDoc examples were unaffected (the rule only reads real import declarations).

Counts (vp lint, per rule): prefer-namespace-imports 0 -> 0 reported at error (52 sites when first flipped, all fixed); no-unsafe-dictionary-type 83 -> 83 (nothing hidden); total warnings 5145 -> 5145, no per-rule delta.

Verification

  • pnpm install --frozen-lockfile pass
  • vp run build pass
  • vp check pass (0 errors, 5145 warnings, unchanged)
  • 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 pass (no issues in changed files)

Changeset

None: internal rename only; emitted declarations do not change meaning.

Notes

No exported signatures change beyond type-parameter names.


Generated by Claude Code

@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a6d435b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@thomasfosterau
thomasfosterau force-pushed the lint-prefer-namespace-imports branch 2 times, most recently from c20a7c6 to 926f1a2 Compare November 12, 2026 05:05
Rename local aliases to the rule's table (Record R, Predicate P, Equal Eq,
Array Arr) and rename colliding resource/requirements type parameters.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY
@thomasfosterau
thomasfosterau force-pushed the lint-prefer-namespace-imports branch from 926f1a2 to e9d4bf4 Compare November 12, 2026 05:19
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY

# Conflicts:
#	examples/blog/test/blog.test.ts
#	src/Resource.filter.test.ts
#	src/internal/codecs.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY
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