Repository navigation
chore(lint): enforce vite-plus/test imports with prefer-vite-plus-imports - #782
Merged
Merged
Conversation
…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>
🚀 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 deploymentPreview Deployments by commit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vp lintandvp checkdid not report imports fromvitest. Vite+ reports them with thevite-plus/prefer-vite-plus-importsrule from itsvite-plus/oxlint-pluginJS plugin. This rule runs only when thelintblock lists both the plugin and the rule.vp createandvp migrateadd them only when a project has nolintblock yet. Void had alintblock before Vite+ added the rule, so the rule never ran here.Changes
vite.config.ts: add thevite-plus/oxlint-pluginJS plugin and setvite-plus/prefer-vite-plus-importstoerror.platform/packages/{api,dashboard}/test: import fromvite-plus/testinstead ofvitest.Behavior
vitestor@vitest/browser*now failsvp lint,vp check, and the staged-files hook.vp check --fixrewrites the import to the matchingvite-plus/test*path.declare module 'vitest'augmentations stay valid. The rule does not report them.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
vitestdevDependency fromplatform/package.jsonor the catalog entry. #781 removes them together with the upgrade.🤖 Generated with Claude Code