Skip to content

chore(lint): enforce vite-plus/test imports with prefer-vite-plus-imports - #782

Merged
cpojer merged 1 commit into
mainfrom
chore/prefer-vite-plus-imports
Nov 11, 2026
Merged

cpojer merged 1 commit into
mainfrom
chore/prefer-vite-plus-imports

Conversation

@fengmk2

@fengmk2 fengmk2 commented Nov 11, 2026

Copy link
Copy Markdown
Member

Summary

vp lint and vp check did not report imports from vitest. Vite+ reports them with the vite-plus/prefer-vite-plus-imports rule from its vite-plus/oxlint-plugin JS plugin. This rule runs only when the lint block lists both the plugin and the rule. vp create and vp migrate add them only when a project has no lint block yet. Void had a lint block before Vite+ added the rule, so the rule never ran here.

Changes

  • vite.config.ts: add the vite-plus/oxlint-plugin JS plugin and set vite-plus/prefer-vite-plus-imports to error.
  • Seven platform test files in platform/packages/{api,dashboard}/test: import from vite-plus/test instead of vitest.

Behavior

  • A new import from vitest or @vitest/browser* now fails vp lint, vp check, and the staged-files hook.
  • vp check --fix rewrites the import to the matching vite-plus/test* path.
  • declare module 'vitest' augmentations stay valid. The rule does not report them.
  • Lint time on the full repository stays about the same: 1.2–1.7 s before, about 1.5 s after.

Relation to #781

#781 makes the same seven import changes as part of the Vite+ 1.6 upgrade. The edits are identical, so the two PRs do not conflict. This PR does not remove the vitest devDependency from platform/package.json or the catalog entry. #781 removes them together with the upgrade.

🤖 Generated with Claude Code

…orts

Enable the `vite-plus/prefer-vite-plus-imports` rule from the
`vite-plus/oxlint-plugin` JS plugin. `vp create` and `vp migrate` add
this rule only when a project has no `lint` block yet. Void had a `lint`
block before the rule existed, so `vp lint` and `vp check` never
reported imports from `vitest`.

Rewrite the seven platform test files that imported from `vitest` to
import from `vite-plus/test`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fengmk2
fengmk2 requested a review from cpojer November 11, 2026 07:08
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://chore-prefer-vite-plus-imports-void-cloud.voidzero-docs.workers.dev (commit 9802d1d)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://34a83067-void-cloud.voidzero-docs.workers.dev 9802d1d 2026-11-11T07:09:05.325Z Visit the dashboard ↗

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@cpojer
cpojer merged commit 0a16210 into main Nov 11, 2026
19 checks passed
@cpojer
cpojer deleted the chore/prefer-vite-plus-imports branch November 11, 2026 07:10
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