fix: support JSONC format in oxlintrc/oxfmtrc migration#1195
Merged
fengmk2 merged 7 commits intovoidzero-dev:mainfrom Mar 29, 2026
Merged
fix: support JSONC format in oxlintrc/oxfmtrc migration#1195fengmk2 merged 7 commits intovoidzero-dev:mainfrom
fengmk2 merged 7 commits intovoidzero-dev:mainfrom
Conversation
This does not actually parse it as a JSONC file still, but it's a valid filename for Oxlint's config file and so should be accepted, as of oxc-project/oxc#19870 Signed-off-by: Connor Shea <connor.james.shea@gmail.com>
✅ Deploy Preview for viteplus-preview canceled.
|
fengmk2
approved these changes
Mar 29, 2026
Member
|
@connorshea Thanks, I will add snap test for this change before merge. |
Verifies that the migrator detects and merges .jsonc config files into vite.config.ts, matching the existing .json behavior.
…tation The migrator detects .oxlintrc.jsonc but fails to parse it when the file contains JSONC features like trailing commas, since it uses JSON.parse instead of a JSONC parser.
4 tasks
Use readJsonFile with allowComments instead of JSON.parse so that .oxlintrc.jsonc files with trailing commas and comments are parsed correctly during migration.
4 tasks
Covers the scenario from voidzero-dev#1193 where oxlint config files contain comments, which caused JSON.parse to crash during migration. Closes voidzero-dev#1193
Reproduces the exact scenario from voidzero-dev#1193 where .oxlintrc.json contains JSONC syntax (comments) which caused JSON.parse to crash.
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
.oxlintrc.jsoncand.oxfmtrc.jsoncas valid config file names in the migrator detectorjsonc-parserinstead ofJSON.parseso oxlint/oxfmt config files with JSONC syntax (comments, trailing commas) are parsed correctly during migration — this also fixes.oxlintrc.jsonfiles that use JSONC syntax, since oxlint supports JSONC regardless of extensionCloses #1193
Ref: oxc-project/oxc#19870