Skip to content

feat: upgrade oxlint to ^1.53.0 and oxfmt to ^0.38.0, remove temp config files#776

Merged
fengmk2 merged 3 commits intomainfrom
remove-oxc-tmp-config-file
Mar 11, 2026
Merged

feat: upgrade oxlint to ^1.53.0 and oxfmt to ^0.38.0, remove temp config files#776
fengmk2 merged 3 commits intomainfrom
remove-oxc-tmp-config-file

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Mar 11, 2026

oxlint@1.53 and oxfmt@0.38 support -c vite.config.ts directly, so the
temp file workaround (.vite-plus-lint.tmp.mts / .vite-plus-fmt.tmp.json)
is no longer needed. This removes ~150 lines of temp file creation and
cleanup machinery from SubcommandResolver.

  • Bump oxfmt ^0.36.0 → ^0.38.0, oxlint ^1.51.0 → ^1.53.0
  • Remove write_temp_ts_config_import, write_temp_json_config_file,
    cleanup_temp_files methods and all call sites
  • Pass -c vite.config.ts directly to oxlint/oxfmt
  • Rename snap tests to reflect new behavior and enhance them to actually
    verify config takes effect (lint-vite-config-rules, fmt-check-with-vite-config)
  • Fix oxlint-typeaware test (add lint: {} for auto-discovery)
  • Add type: module to fmt test package.json files

closes VP-158

@fengmk2 fengmk2 self-assigned this Mar 11, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 11, 2026

Deploy Preview for viteplus-staging canceled.

Name Link
🔨 Latest commit 593b355
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-staging/deploys/69b133d3cc378d0008cc2182

Copy link
Copy Markdown
Member Author

fengmk2 commented Mar 11, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@fengmk2 fengmk2 marked this pull request as ready for review March 11, 2026 06:49
Copy link
Copy Markdown
Contributor

@leaysgur leaysgur left a comment

Choose a reason for hiding this comment

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

Once this has released, we should be able to start the VSCode verification. 🆚

Copy link
Copy Markdown
Member Author

fengmk2 commented Mar 11, 2026

Once this has released, we should be able to start the VSCode verification. 🆚

​will release soon after merged.

@linear
Copy link
Copy Markdown

linear Bot commented Mar 11, 2026

VP-158 Add `baseDir` field at oxlint and oxfmt configuration

Is it possible to add a configuration for baseDir, allowing all path-related configurations in the config file to be resolved based on this specified baseDir?
Because vite+ temporarily places the configuration file in a hidden directory under node_modules, currently, there are various issues with relative path addressing.

{
  "baseDir": "/foo/bar/project",
  "ignorePatterns": ["dist/**"],
  "extends": [
    "./packages/oxlint-config/index.jsonc"
  ]
}

Currently, our temporary solution is to create a temporary json file in the same directory as the vite.config.ts file to be passed to oxlint and oxfmt for execution, which will be automatically deleted after completion.

@fengmk2 fengmk2 force-pushed the remove-oxc-tmp-config-file branch from b7d08cf to 6f30c0d Compare March 11, 2026 09:13
Copy link
Copy Markdown
Member Author

fengmk2 commented Mar 11, 2026

https://linear.app/voidzero/issue/VP-242/bug-vp-lintfmt-in-sub-workspace-should-resolve-root-config Even when running vp lint in a sub workspace, it automatically finds and passes the root workspace configuration.

@fengmk2 fengmk2 force-pushed the remove-oxc-tmp-config-file branch from 6f30c0d to 593b355 Compare March 11, 2026 09:20
fengmk2 added 3 commits March 11, 2026 09:33
…fig files

oxlint@1.53 and oxfmt@0.38 support `-c vite.config.ts` directly, so the
temp file workaround (.vite-plus-lint.tmp.mts / .vite-plus-fmt.tmp.json)
is no longer needed. This removes ~150 lines of temp file creation and
cleanup machinery from SubcommandResolver.

- Bump oxfmt ^0.36.0 → ^0.38.0, oxlint ^1.51.0 → ^1.53.0
- Remove write_temp_ts_config_import, write_temp_json_config_file,
  cleanup_temp_files methods and all call sites
- Pass `-c vite.config.ts` directly to oxlint/oxfmt
- Rename snap tests to reflect new behavior and enhance them to actually
  verify config takes effect (lint-vite-config-rules, fmt-check-with-vite-config)
- Fix oxlint-typeaware test (add lint: {} for auto-discovery)
- Add type: module to fmt test package.json files
oxlint 1.53 and oxfmt 0.38 auto-discover vite.config.ts from CWD.
When the config lacks a `fmt` or `lint` field, they error out. This
injects `fmt: {}` defaults during create, migrate, and lint --init
flows so oxfmt auto-discovery always succeeds.

- Add `injectFmtDefaults()` in migrator.ts for create/migrate flows
- Add `injectFmtDefaultsIfMissing()` in init-config.ts for lint --init
- Extract shared `injectConfigDefaults()` helper in migrator.ts
- Add `lint: {}`/`fmt: {}` and `"type": "module"` to snap test configs
- Update snap test outputs for version upgrade changes
- Fix init-config test setup for oxfmt auto-discovery
Verify that running `vp lint` from a sub-workspace uses the root
workspace's vite.config.ts lint rules and ignores the sub-workspace's
own vite.config.ts configuration.
@fengmk2 fengmk2 force-pushed the remove-oxc-tmp-config-file branch from 593b355 to 0826085 Compare March 11, 2026 09:33
Copy link
Copy Markdown
Member Author

fengmk2 commented Mar 11, 2026

Merge activity

  • Mar 11, 9:33 AM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 11, 9:52 AM UTC: @fengmk2 merged this pull request with Graphite.

@fengmk2 fengmk2 merged commit 2764ddd into main Mar 11, 2026
18 checks passed
@fengmk2 fengmk2 deleted the remove-oxc-tmp-config-file branch March 11, 2026 09:52
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.

3 participants