Switch fedify init templates to Oxfmt and Oxlint#818
Conversation
Generated Node.js and Bun projects now share the Oxc toolchain for formatting and linting. The generated Oxlint config loads Fedify's rules through @fedify/lint/oxlint, and generated projects get Oxc editor recommendations and package scripts for format, format:check, and lint. The init test harness now runs the generated formatter and linter for hydrated Node.js and Bun projects. Framework scaffolders that produce conflicting ESLint artifacts or unformatted files are cleaned up before Fedify writes its files. Closes fedify-dev#703 Assisted-by: Codex:gpt-5.5
✅ Deploy Preview for fedify-json-schema ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR replaces Biome and ESLint in all Node.js/Bun projects generated by ChangesBiome/ESLint → Oxfmt/Oxlint switch in fedify init
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request replaces Biome and ESLint with Oxfmt and Oxlint for Node.js and Bun projects generated by fedify init. It updates initializer templates, configurations, VS Code settings, package dependencies, and documentation to support the new Oxc-based toolchain. Additionally, it introduces a file cleanup step during scaffolding to remove default framework linter configurations and updates JSON formatting utilities. Feedback on the changes suggests adding a depth limit to the recursive formatJsonValue function to prevent potential stack overflow issues, and utilizing the generated logger constant within the default federation template's actor dispatcher to avoid triggering an immediate unused variable warning from Oxlint.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/init/src/json/oxlint.json`:
- Around line 3-11: The oxlint.json ignorePatterns array is missing the Markdown
file pattern that is present in oxfmt.json, creating an inconsistency in how
Markdown files are handled between the two configurations. Add "**/*.md" to the
ignorePatterns array in oxlint.json to match the exclusion behavior of
oxfmt.json and ensure consistent handling of Markdown files across both linting
and formatting configurations.
In `@packages/init/src/webframeworks.test.ts`:
- Around line 118-123: Add an additional assertion to check that
eslint.config.mjs is also undefined, matching the existing check for
eslint.config.ts. Insert a new equal() call immediately after the
eslint.config.ts assertion that verifies
initializer.files?.["eslint.config.mjs"] is undefined to ensure both ESLint
configuration file variants are properly handled in this test.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 53603b84-f396-4e95-88fe-42e1bdea47b6
📒 Files selected for processing (46)
CHANGES.mddocs/cli.mddocs/install.mddocs/tutorial/astro-blog.mddocs/tutorial/content-sharing.mddocs/tutorial/microblog.mddocs/tutorial/threadiverse.mdpackages/init/src/action/cleanup.tspackages/init/src/action/configs.test.tspackages/init/src/action/configs.tspackages/init/src/action/deps.tspackages/init/src/action/mod.tspackages/init/src/action/patch.tspackages/init/src/action/templates.tspackages/init/src/json/biome.jsonpackages/init/src/json/deps.jsonpackages/init/src/json/oxfmt.jsonpackages/init/src/json/oxlint.jsonpackages/init/src/json/vscode-settings.jsonpackages/init/src/templates/bare-bones/main/bun.ts.tplpackages/init/src/templates/bare-bones/main/node.ts.tplpackages/init/src/templates/defaults/eslint.config.ts.tplpackages/init/src/templates/defaults/federation.oxc.ts.tplpackages/init/src/templates/elysia/index/bun.ts.tplpackages/init/src/templates/elysia/index/node.ts.tplpackages/init/src/templates/hono/index/node.ts.tplpackages/init/src/templates/next/middleware.ts.tplpackages/init/src/templates/nitro/nitro.config.ts.tplpackages/init/src/templates/nitro/server/error.ts.tplpackages/init/src/templates/nitro/server/middleware/federation.ts.tplpackages/init/src/templates/nitro/server/routes/index.ts.tplpackages/init/src/test/create.tspackages/init/src/types.tspackages/init/src/utils.tspackages/init/src/webframeworks.test.tspackages/init/src/webframeworks/astro.tspackages/init/src/webframeworks/bare-bones.tspackages/init/src/webframeworks/const.tspackages/init/src/webframeworks/elysia.tspackages/init/src/webframeworks/express.tspackages/init/src/webframeworks/hono.tspackages/init/src/webframeworks/next.tspackages/init/src/webframeworks/nitro.tspackages/init/src/webframeworks/nuxt.tspackages/init/src/webframeworks/solidstart.tspackages/init/src/webframeworks/utils.ts
💤 Files with no reviewable changes (2)
- packages/init/src/json/biome.json
- packages/init/src/templates/defaults/eslint.config.ts.tpl
Generated federation files now exercise the logger they create, and the Hono and Express app templates no longer create unused logger constants. This keeps generated Oxc projects warning-free while still showing LogTape through the federation setup. The JSON formatter now rejects values deeper than 100 levels before recursively walking them. The generated Oxlint config also ignores Markdown files to match Oxfmt, and tests cover the Markdown ignore plus both ESLint config file variants. fedify-dev#818 (comment) fedify-dev#818 (comment) fedify-dev#818 (comment) fedify-dev#818 (comment) Assisted-by: Codex:gpt-5.5
|
/gemini review |
|
@codex review |
There was a problem hiding this comment.
Code Review
This pull request switches the generated Node.js and Bun projects in fedify init from Biome and ESLint to Oxfmt and Oxlint, updating the corresponding documentation, configuration templates, VS Code settings, and framework initializers. It also introduces a cleanup step to remove scaffolded ESLint artifacts and implements a custom JSON formatter (formatJsonValue) in packages/init/src/utils.ts to pretty-print configuration files. Feedback on the custom JSON formatter suggests handling objects with a custom toJSON method to align with standard JSON.stringify behavior.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae2477f1d0
ℹ️ 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".
The JSON formatter now respects values that serialize themselves with toJSON, including Date-like values, while keeping the recursive depth guard separate from formatting indentation. Tests cover both the deep-value guard and the custom serializer path. The Threadiverse tutorial now matches the generated federation scaffold, which keeps its LogTape logger and uses it in the actor dispatcher instead of asking readers to delete it. fedify-dev#818 (comment) fedify-dev#818 (comment) Assisted-by: Codex:gpt-5.5
|
@codex review |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request transitions generated Node.js and Bun projects from Biome and ESLint to Oxfmt and Oxlint, updating documentation, configuration templates, and test suites. It also introduces a cleanup step to remove framework-scaffolded files and package.json scripts. Feedback on the changes highlights that deleting tsconfig.json in Nitro projects will break type resolution for virtual imports and auto-generated types, suggesting merging the custom compiler options instead of deleting the file.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Nitro scaffolds can create a tsconfig.json that carries framework metadata such as an extends entry. The cleanup step now keeps that file so patchFiles can merge Fedify's compiler options into it instead of replacing the framework configuration. JSON merging now accepts the JSONC shape used by Nitro's template, including comments and trailing commas. A regression test covers preserving Nitro's extends value while adding Fedify's compiler options. fedify-dev#818 (comment) Assisted-by: Codex:gpt-5.5
|
@codex review |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request transitions generated Node.js and Bun projects from Biome and ESLint to Oxfmt and Oxlint. It updates the documentation, templates, and dependencies to reflect this change, and introduces a cleanup step to remove scaffolded ESLint/Biome artifacts. Additionally, a custom JSON formatter (formatJson) is implemented in packages/init/src/utils.ts. Feedback on the changes suggests avoiding the expansion of the fragile regex-based JSONC parsing in patch.ts in favor of a robust AST-based rewrite, and updating the custom JSON serializer to omit functions and symbols to align with standard JSON.stringify behavior.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/init/src/action/patch.ts`:
- Around line 318-323: The removeJsoncSyntax function uses regex patterns that
are not aware of string boundaries, causing it to incorrectly strip comment-like
patterns from inside string values (e.g., URLs). Replace the regex-based
approach with a character-by-character scanner that tracks whether the parser is
inside a string literal, and only apply comment removal and trailing comma
removal when outside of strings. Keep track of string state by monitoring
unescaped double quotes, ensuring that content between quotes is never modified
by the regex patterns.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: dbd369e8-f6c8-4c68-be33-ad9897bc9426
📒 Files selected for processing (3)
packages/init/src/action/configs.test.tspackages/init/src/action/patch.tspackages/init/src/webframeworks/nitro.ts
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Generated Nitro tsconfig files can include URL strings and other values that look like JSONC comments. The JSONC cleanup now scans the text and removes comments and trailing commas only outside string literals, so patching keeps existing string values intact. fedify-dev#818 (comment) fedify-dev#818 (comment) Assisted-by: Codex:gpt-5.5
The custom JSON formatter now matches JSON.stringify for object properties whose values cannot be serialized. Function, symbol, and undefined property values are omitted, while array entries still serialize to null. fedify-dev#818 (comment) Assisted-by: Codex:gpt-5.5
|
@codex review |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request replaces Biome and ESLint with Oxfmt and Oxlint for generated Node.js and Bun projects, updating the initialization templates, tests, and documentation. It also adds a cleanup step to remove pre-existing ESLint/Biome configurations. Feedback suggests that the custom removeJsoncSyntax parser implemented in packages/init/src/action/patch.ts is fragile and should be replaced with a robust AST parser or an established library like jsonc-parser in a dedicated follow-up.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/init/src/action/patch.ts`:
- Around line 375-381: The trailing comma detection logic in the lookahead
section does not account for JSONC comments that may appear between the comma
and the closing bracket/brace. When a comma is followed by a comment before `}`
or `]`, the code fails to identify it as a trailing comma, leaving invalid JSON
after comments are stripped. Modify the while loop that currently only skips
whitespace characters to also skip over JSONC-style comments (both `//` line
comments and `/* */` block comments) when advancing the lookahead pointer, so
that the subsequent check for `}` or `]` correctly identifies trailing commas
regardless of intervening comments.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: c00fba08-3dd2-4e04-9e54-921950de8d3b
📒 Files selected for processing (4)
packages/init/src/action/configs.test.tspackages/init/src/action/patch.tspackages/init/src/utils.test.tspackages/init/src/utils.ts
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
The init patch step now parses existing JSONC files with jsonc-parser instead of maintaining a custom comment and trailing comma scanner. This preserves string contents, handles comments between trailing commas and closing tokens, and keeps Nitro tsconfig merging on a tested parser. fedify-dev#818 (comment) fedify-dev#818 (comment) Assisted-by: Codex:gpt-5.5
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request transitions the Node.js and Bun projects generated by fedify init from Biome and ESLint to Oxfmt and Oxlint. It introduces a new cleanup step to remove default framework scaffolding artifacts (such as ESLint configurations), integrates jsonc-parser for robust JSONC parsing, and updates all relevant documentation, templates, configurations, and tests to support the new Oxc-based formatting and linting toolchain. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Closes #703.
This switches generated Node.js and Bun projects from Biome plus ESLint to the Oxc toolchain. New projects now get .oxfmtrc.json and .oxlintrc.json, Oxc editor recommendations, and
format,format:check, andlintpackage scripts backed byoxfmtandoxlint.The generated Oxlint config uses
@fedify/lint/oxlint, which was added in #702. Deno projects keep their existing Deno formatter and linter path. The shared federation template is split so Deno scaffolds keep the Deno-formatted packages/init/src/templates/defaults/federation.ts.tpl, while Node.js and Bun scaffolds use packages/init/src/templates/defaults/federation.oxc.ts.tpl for Oxfmt-compatible output.What changed
Testing
deno task -f @fedify/init checkpnpm -C packages/init testmise run check-each init lintmise run checkdeno fmt --check.npm run format:checkandnpm run lint.test-initsmoke checks for npm projects across bare-bones, Hono, Express, Elysia, Astro, Next.js, Nitro, Nuxt, and SolidStart, plus representative Bun scaffolds.I did not use the full
mise run test:initmatrix as a final gate because the existing Deno hyd path fails before lookup in this checkout with an import-map error from packages/cli/src/kv.node.ts. The Node.js and Bun formatter/linter paths covered by this PR were checked with generated projects instead.