Skip to content

refactor: move typeAware/typeCheck from CLI flags to vite.config.ts - #739

Merged
fengmk2 merged 8 commits into
mainfrom
improve-vp-check
Mar 9, 2026
Merged

refactor: move typeAware/typeCheck from CLI flags to vite.config.ts#739
fengmk2 merged 8 commits into
mainfrom
improve-vp-check

Conversation

@fengmk2

Copy link
Copy Markdown
Member

oxlint natively reads options.typeAware and options.typeCheck from
its config file, so there's no need for vp check to inject these as
CLI flags when calling vp lint.

  • Remove --no-type-aware / --no-type-check flags from vp check
  • Add options: { typeAware: true, typeCheck: true } defaults in
    vp lint --init, vp migrate, and project root vite.config.ts
  • Strip --type-aware / --type-check from migrated scripts
  • Remove oxc.typeAware from VS Code settings (extension reads from
    config automatically)
  • Add OxlintOptions type with typeAware and typeCheck fields

@netlify

netlifyBot commented Mar 9, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-staging canceled.

NameLink
🔨 Latest commit69220fb
🔍 Latest deploy loghttps://app.netlify.com/projects/viteplus-staging/deploys/69aef54fce7ba500082dfe2e

@fengmk2fengmk2 self-assigned this Mar 9, 2026
@fengmk2Graphite App

fengmk2 commented Mar 9, 2026

Copy link
Copy Markdown
MemberAuthor

@fengmk2
fengmk2 changed the base branch from main to graphite-base/739March 9, 2026 08:48
@fengmk2
fengmk2 changed the base branch from graphite-base/739 to export-lint-and-fmt-typesMarch 9, 2026 08:48
@fengmk2
fengmk2force-pushed the export-lint-and-fmt-types branch from 82abaa7 to 2d8a8dbCompareMarch 9, 2026 08:56
@fengmk2
fengmk2 marked this pull request as ready for review March 9, 2026 08:58
@fengmk2
fengmk2 requested review from cpojer and leaysgurMarch 9, 2026 08:59
Comment threadpackages/cli/src/utils/editor.ts
@leaysgur
leaysgur requested a review from camc314March 9, 2026 09:07
@fengmk2
fengmk2 changed the base branch from export-lint-and-fmt-types to graphite-base/739March 9, 2026 11:11
@fengmk2
fengmk2force-pushed the graphite-base/739 branch 2 times, most recently from 9c62ad8 to 9121608CompareMarch 9, 2026 11:42
@graphite-app
graphite-appBot changed the base branch from graphite-base/739 to mainMarch 9, 2026 11:42
Remove the 874-line hand-written oxlint-config.ts and import OxlintConfig
directly from the oxlint package, which already exports the same type.
Clean up related lint overrides and typos exclusions for the deleted file.
Comment threadrfcs/migration-command.md Outdated
oxlint's TypeScript checker (tsgolint) does not support baseUrl in
tsconfig.json, causing lint failures after migration. Guard both
migration and lint --init paths to omit typeAware/typeCheck defaults
when baseUrl is present.
When tsconfig.json has baseUrl and we skip injecting typeAware/typeCheck,
log a warning with actionable advice to run `npx @andrewbranch/ts5to6
--fixBaseUrl .` to remove baseUrl. Added warning in both migration and
lint --init paths. Updated snap test fixture with .oxlintrc.json to
capture the warning output.
…hed package
The static import of init-config.js in bin.ts transitively loads
detect-indent (a devDependency), causing ERR_MODULE_NOT_FOUND when
vite-plus is installed as a dependency. Change to dynamic import so
it's only loaded for local commands that actually need it.
Fixes frm-stack E2E test failure.
The previous lazy-import fix was insufficient — init-config.js is still
loaded for all non-global commands. The actual root cause is that these
packages were in devDependencies but are imported at runtime by
tsc-compiled dist/utils/json.js. Move them to dependencies so they're
available when vite-plus is installed in other projects.
Comment threadpackages/cli/package.json Outdated
…t-indent dependency chain
Move hasBaseUrlInTsconfig from utils/json.ts (which imports detect-indent)
to a new utils/tsconfig.ts that uses only Node.js builtins. This breaks the
transitive dependency chain from init-config.ts → json.ts → detect-indent,
allowing detect-indent/detect-newline to remain devDependencies since they
are only used by rolldown-bundled global CLI code.
…nto vite.config.ts
The $schema annotation in .oxlintrc.json/.oxfmtrc.json causes TS2769
type errors when merged into vite.config.ts because it's not part of
OxlintConfig/OxfmtConfig types. Strip it before merging.
Comment threadcrates/vite_migration/src/vite_config.rs
@fengmk2Graphite App

fengmk2 commented Mar 9, 2026

Copy link
Copy Markdown
MemberAuthor

Merge activity

  • Mar 9, 5:04 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 9, 5:04 PM UTC: @fengmk2 merged this pull request with Graphite.

@fengmk2
fengmk2 merged commit 189d2b3 into mainMar 9, 2026
38 checks passed
@fengmk2
fengmk2 deleted the improve-vp-check branch March 9, 2026 17:04
MahmoodKhalil57 added a commit to MahmoodKhalil57/vite-plus that referenced this pull request Mar 14, 2026
The `--no-type-check` flag was removed from `vp check` in voidzero-dev#739, but the
help examples section still referenced it. Replace with `--no-lint` which
is a valid flag.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fengmk2 added a commit that referenced this pull request Mar 16, 2026
…#875)
## Summary
- The `--no-type-check` flag was removed from `vp check` in #739, but
the help examples section still referenced it
- Replace with `--no-lint` which is a valid flag
Fixes#879
One-line change in `crates/vite_global_cli/src/help.rs`.
## Context
The Options section was correctly cleaned up in #739, but the Examples
block ~18 lines below it was missed:
```diff
- vp check --no-type-check src/index.ts
+ vp check --no-lint src/index.ts
```
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: MK <fengmk2@gmail.com>
fengmk2 pushed a commit that referenced this pull request May 27, 2026
If tsconfig has comments, JSON.parse fails and we can't detect nor
remove baseUrl!
This PR resolves this.
Related: #739
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: e2eAuto run e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@fengmk2@cpojer@camc314