chore(lint): use vue-tsc for staged .vue type-checking#181
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Bundle ReportBundle 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.
5e03f5b to
037b67d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
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.jsfromtsctovue-tsc. - Add an inline note clarifying why
vue-tscis required for.vuemodule type information.
Summary
One-line fix to
scripts/lint-staged-vue.js: the staged-files type-check for.vuefiles invoked plaintsc, which cannot resolve named imports from.vuemodules (onlyvue-tsccan — it reads<script>blocks). Switch tovue-tscto match whatscripts/lint-staged-ts.jsalready does forVueApp/src/files.Why now
Since main commit
72491d42 feat(clinical-scheduler): Phase 4 Add bulk deletion, three composables import named types (ScheduleSemester,ScheduleAssignment) fromScheduleView.vue:VueApp/src/ClinicalScheduler/composables/use-bulk-deletion-logic.tsVueApp/src/ClinicalScheduler/composables/use-delete-mode.tsVueApp/src/ClinicalScheduler/composables/use-schedule-normalization.tsThe pre-commit hook trips on these on every Vue commit even though the project's actual build (
vue-tsc --buildinnpm run verify:build) is happy. CI uses vue-tsc, so this is hook-only friction.Test plan
npm run lint -- <any .vue file>passes (previously failed with "Found 4 errors in 3 files")refactor/dead-code-and-shared-chromeno longer tripsRelated
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-verifybecause of this hook bug. Once this lands, those (and any future Vue-touching commits in PRs 178/179) won't need the bypass.