Skip to content

feat(cli): add --no-type-check to vp check#1417

Draft
jong-kyung wants to merge 10 commits intovoidzero-dev:mainfrom
jong-kyung:feat/check-no-type-check
Draft

feat(cli): add --no-type-check to vp check#1417
jong-kyung wants to merge 10 commits intovoidzero-dev:mainfrom
jong-kyung:feat/check-no-type-check

Conversation

@jong-kyung
Copy link
Copy Markdown
Collaborator

@jong-kyung jong-kyung commented Apr 18, 2026

Summary

Implements the 3-phase skip-flag matrix for vp check agreed on in #1275.
Each of format / lint rules / type check can now be skipped independently:

Flag Skips
--no-fmt Format check
--no-lint Lint rules (type check still runs when enabled in config)
--no-type-check Type check

vp check --fix --no-lint on a typeCheck: true project is rejected up front to avoid leaving the working tree partially formatted inside pre-commit hooks.

Request for feedback: sidecar.rs

--no-type-check is implemented via a per-invocation .mjs sidecar that overrides lint.options.typeCheck. It leans on oxlint's loadVitePlusConfigs route loading -c <path> via dynamic import(), so we can toggle the flag without mutating vite.config.ts.

This is the part of the PR I'd especially appreciate reviewer input on.
One approach I also considered was a wrapper .mjs that imports the original vite.config.ts and patches typeCheck in place — this would preserve non-serializable lint values but complicates relative-path resolution from the temp dir. Happy to switch to that, or to another pattern if the project has a preferred direction for per-invocation config overrides in the Rust binding.

Related

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 18, 2026

Deploy Preview for viteplus-preview ready!

Name Link
🔨 Latest commit e835c07
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69e379126a7fed00082afa2e
😎 Deploy Preview https://deploy-preview-1417--viteplus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jong-kyung jong-kyung requested a review from fengmk2 April 18, 2026 12:32
@jong-kyung
Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e835c07184

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +88 to +89
let raw_temp_path = std::env::temp_dir().join(filename_str);
let sidecar_path = AbsolutePathBuf::new(raw_temp_path).ok_or_else(|| {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep sidecar config in project path scope

This writes the --no-type-check override config under the system temp directory, which changes how Oxlint resolves config-file-relative entries. Oxlint resolves extends and JS plugin specifiers relative to the -c file path (for example, see https://oxc.rs/docs/guide/usage/linter/nested-config and https://oxc.rs/docs/guide/usage/linter/js-plugins), so a project using relative extends/jsPlugins will break or lint the wrong config when vp check --no-type-check points to /tmp/vite-plus-no-type-check-*.mjs instead of the project config location.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

@jong-kyung jong-kyung Apr 20, 2026

Choose a reason for hiding this comment

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

P1 Badge Keep sidecar config in project path scope

This writes the --no-type-check override config under the system temp directory, which changes how Oxlint resolves config-file-relative entries. Oxlint resolves extends and JS plugin specifiers relative to the -c file path (for example, see https://oxc.rs/docs/guide/usage/linter/nested-config and https://oxc.rs/docs/guide/usage/linter/js-plugins), so a project using relative extends/jsPlugins will break or lint the wrong config when vp check --no-type-check points to /tmp/vite-plus-no-type-check-*.mjs instead of the project config location.

Useful? React with 👍 / 👎.

This path doesn't go through standard oxlint config resolution. With VP_VERSION set, cli.ts uses loadVitePlusConfigs, which import()s the sidecar and hands .default.lint to Rust as a plain JSON object — the sidecar file path isn't a resolution root.

@jong-kyung jong-kyung marked this pull request as ready for review April 20, 2026 04:10
resolver,
SynthesizableSubcommand::Lint { args },
Some(&resolved_vite_config),
Some(lint_vite_config),
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.

#1378 The -c parameter specifying oxlint configuration will be removed, so the sidecar configuration approach will have issues. Going forward, the configuration resolution logic for oxlint and oxfmt will no longer be controlled by Vite+, and will be handed back to oxlint/fmt themselves to handle.

cc @leaysgur @camc314 Do you have any better suggestions?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

will be handed back to oxlint/fmt themselves to handle.

I think this is the only option.

Otherwise, Vite+ would end up handling everything, including searching for nested configs.
(That might be a valid decision in itself, but as far as I know, there are currently no plans to do so?)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

#1378 The -c parameter specifying oxlint configuration will be removed, so the sidecar configuration approach will have issues. Going forward, the configuration resolution logic for oxlint and oxfmt will no longer be controlled by Vite+, and will be handed back to oxlint/fmt themselves to handle.

cc @leaysgur @camc314 Do you have any better suggestions?

Thanks for the heads up on #1378. Since the sidecar + -c approach won't survive that change, what would be the recommended direction for implementing --no-type-check going forward?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@fengmk2 what's the use case for the --no-type-check flag?

@jong-kyung jong-kyung marked this pull request as draft April 21, 2026 10:06
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.

Add vp typecheck command

4 participants