Skip to content

chore(lint): use vue-tsc for staged .vue type-checking#181

Merged
rlorenzo merged 1 commit into
mainfrom
tools/lint-vue-tsc
May 7, 2026
Merged

chore(lint): use vue-tsc for staged .vue type-checking#181
rlorenzo merged 1 commit into
mainfrom
tools/lint-vue-tsc

Conversation

@rlorenzo
Copy link
Copy Markdown
Contributor

@rlorenzo rlorenzo commented May 7, 2026

Summary

One-line fix to scripts/lint-staged-vue.js: the staged-files type-check for .vue files invoked plain tsc, which cannot resolve named imports from .vue modules (only vue-tsc can — it reads <script> blocks). Switch to vue-tsc to match what scripts/lint-staged-ts.js already does for VueApp/src/ files.

Why now

Since main commit 72491d42 feat(clinical-scheduler): Phase 4 Add bulk deletion, three composables import named types (ScheduleSemester, ScheduleAssignment) from ScheduleView.vue:

  • VueApp/src/ClinicalScheduler/composables/use-bulk-deletion-logic.ts
  • VueApp/src/ClinicalScheduler/composables/use-delete-mode.ts
  • VueApp/src/ClinicalScheduler/composables/use-schedule-normalization.ts

The pre-commit hook trips on these on every Vue commit even though the project's actual build (vue-tsc --build in npm run verify:build) is happy. CI uses vue-tsc, so this is hook-only friction.

Test plan

  • CI green
  • npm run lint -- <any .vue file> passes (previously failed with "Found 4 errors in 3 files")
  • Pre-commit hook on a Vue change in branch refactor/dead-code-and-shared-chrome no longer trips

Related

Surfaced while addressing CodeRabbit review comments on PR #177 — all three commits in this round of PR 177 fixes had to be made with --no-verify because of this hook bug. Once this lands, those (and any future Vue-touching commits in PRs 178/179) won't need the bypass.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • review-ready

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7a1735db-dda8-44f9-b48d-23ab5e35cd54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tools/lint-vue-tsc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov-commenter
Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

Plain tsc cannot resolve named imports from .vue files (e.g.
`import type { ScheduleSemester } from "./ScheduleView.vue"`),
which made the staged-files type-check in scripts/lint-staged-vue.js
fail on every Vue commit since 72491d4 (Phase 4 bulk deletion)
introduced those imports. lint-staged-ts.js already uses vue-tsc
for VueApp/src/ files; this mirrors that for the .vue path.
@rlorenzo rlorenzo force-pushed the tools/lint-vue-tsc branch from 5e03f5b to 037b67d Compare May 7, 2026 15:48
@rlorenzo rlorenzo requested a review from Copilot May 7, 2026 15:49
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.95%. Comparing base (e3d52ee) to head (037b67d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #181   +/-   ##
=======================================
  Coverage   42.95%   42.95%           
=======================================
  Files         873      873           
  Lines       51046    51046           
  Branches     4762     4762           
=======================================
  Hits        21925    21925           
  Misses      28598    28598           
  Partials      523      523           
Flag Coverage Δ
backend 43.01% <ø> (ø)
frontend 41.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the Vue pre-commit (staged-file) type-check step to use vue-tsc instead of plain tsc, aligning the hook behavior with the project’s actual Vue type-check pipeline and preventing false failures when .ts files import named types from .vue modules.

Changes:

  • Switch staged “app” type-checking in scripts/lint-staged-vue.js from tsc to vue-tsc.
  • Add an inline note clarifying why vue-tsc is required for .vue module type information.

@rlorenzo rlorenzo merged commit 3765296 into main May 7, 2026
16 checks passed
@rlorenzo rlorenzo deleted the tools/lint-vue-tsc branch May 7, 2026 15:53
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.

3 participants