Skip to content

chore(server): drop the unused question service type anchor - #88

Merged
elkaix merged 3 commits into
mainfrom
chore/drop-question-service-type-anchor
Aug 16, 2026
Merged

chore(server): drop the unused question service type anchor#88
elkaix merged 3 commits into
mainfrom
chore/drop-question-service-type-anchor

Conversation

@elkaix

@elkaix elkaix commented Aug 16, 2026

Copy link
Copy Markdown
Member

Related Issue

Follow-up to a review finding on #85, deliberately deferred there to keep that bug-fix PR free of
drive-by edits.

Problem

packages/server/src/services/question/questionService.ts carried:

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _typeAnchor: typeof IQuestionService = IQuestionService;

The const existed only to keep the IQuestionService import referenced at runtime, and it needed a
lint suppression to survive. Oxlint still reported no-underscore-dangle on it.

What changed

IQuestionService moves to a type-only import and the anchor plus its suppression are deleted. The
class already names the interface in a type position (implements IQuestionService), which is the
only reference this file needs.

Verification

Because the identifier is a DI decorator, a green typecheck alone would not prove the runtime
registration still works — so the full server suite was the gate:

  • pnpm --filter @pymodel/server exec vitest run503 passed (43 files).
  • pnpm --filter @pymodel/server exec tsc -p tsconfig.json --noEmit — exit 0.
  • pnpm run lint — exit 0.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works. — No new behaviour; the existing server suite covers the DI wiring this touches.
  • Ran gen-changesets skill, or this PR needs no changeset. — @pymodel/server is changeset-ignored.
  • Ran gen-docs skill, or this PR needs no doc update.

Summary by CodeRabbit

  • Refactor
    • Simplified internal type imports and removed unused declarations.
    • No user-facing behavior changes.

The runtime const existed only to keep the IQuestionService import
referenced, and needed an eslint suppression to survive. The class
already names the interface in a type position, so a type-only import
carries it.
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fa2e1ca4-3e5a-441c-8cfc-4f93fb5b347d

📥 Commits

Reviewing files that changed from the base of the PR and between 04b26cf and b7ead6d.

📒 Files selected for processing (1)
  • packages/server/src/services/question/questionService.ts

Included review availability: Your plan includes up to 3 reviews per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The question service now imports IQuestionService as a type-only dependency and removes the unused runtime type anchor. Other imports remain unchanged.

Changes

Question service import cleanup

Layer / File(s) Summary
Type-only service contract import
packages/server/src/services/question/questionService.ts
IQuestionService uses a type-only import. The unused _typeAnchor declaration is removed. Protocol type imports remain unchanged.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to b7ead

This change removes an unused runtime type anchor while preserving the interface's type-only usage; the localized cleanup is merge-ready after normal checks, with no actionable merge-blocking risk remaining.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the chore prefix, imperative mood, and clearly describes the change within 72 characters.
Description check ✅ Passed The description includes all required sections, explains the change, links the related issue, documents verification, and completes the checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 16, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pymodel/pythinker-code@c1022fe
npx https://pkg.pr.new/@pymodel/pythinker-code@c1022fe

commit: c1022fe

@elkaix
elkaix merged commit 27294e8 into main Aug 16, 2026
11 checks passed
@elkaix
elkaix deleted the chore/drop-question-service-type-anchor branch August 16, 2026 05:58
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.

1 participant