Skip to content

fix(wbfy): keep generated lint configs runnable - #1285

Closed
exKAZUu wants to merge 2 commits into
mainfrom
fix/wbfy-legacy-oxfmt
Closed

exKAZUu wants to merge 2 commits into
mainfrom
fix/wbfy-legacy-oxfmt

Conversation

@exKAZUu

@exKAZUu exKAZUu commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • remove superseded JSON Oxfmt and Oxlint configs after writing their managed TypeScript replacements
  • include generated root tool configs in framework-owned TypeScript projects
  • cover both behaviors with generator-level regression tests

Verification

  • WB_ENV=test bun run verify-full
  • local bun start /Users/exkazuu/ghq/github.com/exKAZUu-Research/trace-dojo from packages/wbfy

Remove superseded JSON configs after their TypeScript replacements are
written, and include generated root tool configs in framework tsconfig
projects.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the configuration management lifecycle within the wbfy package. It ensures that legacy JSON-based linting and formatting configurations are cleaned up only after successful migration to TypeScript-based equivalents, preventing potential configuration gaps. Additionally, it enhances TypeScript project inclusion rules to better support generated root tool configurations.

Highlights

  • Legacy Config Cleanup: Implemented logic to safely remove legacy .oxfmtrc.json and .oxlintrc.json files only after their TypeScript-based replacements have been successfully generated.
  • TypeScript Project Configuration: Updated tsconfig generation to include *.config.ts files in the 'include' array for framework-owned projects, ensuring generated root tool configs are properly recognized.
  • Regression Testing: Added new unit tests to verify the cleanup of legacy configuration files and the correct inclusion of tool configs in tsconfig.json.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.


Old JSON files now fade away, / As TypeScript takes the light of day. / With configs kept in proper place, / The project runs with cleaner grace.

Footnotes

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the wbfy generators to safely remove legacy .oxfmtrc.json and .oxlintrc.json configuration files only after their TypeScript replacements are successfully generated. It also updates the framework tsconfig.json generator to include *.config.ts in the include array. The review feedback points out that unconditionally sorting the include array in tsconfig.json can trigger unnecessary file rewrites, which would strip comments and custom formatting. It suggests only sorting the array when a new element is actually added.

Comment on lines +359 to 368
function addManagedIncludesForFrameworkProject(settings: TsConfigJson): void {
// Omitting include lets framework tsconfigs keep TypeScript's default
// "all TS/TSX files" behavior, which already covers scripts.
// "all TS/TSX files" behavior, which already covers both paths.
if (!settings.include) return;
if (settings.include.includes('scripts/**/*')) return;

settings.include.push('scripts/**/*');
for (const managedInclude of ['*.config.ts', 'scripts/**/*']) {
if (!settings.include.includes(managedInclude)) settings.include.push(managedInclude);
}
settings.include.sort();
}

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.

medium

Unconditionally sorting settings.include will modify the array's order even if no new elements were added. This causes JSON.stringify(settings) === originalSettingsJson to evaluate to false if the original include array was unsorted, triggering an unnecessary rewrite of tsconfig.json and stripping all JSONC comments and custom formatting.\n\nBy only sorting when an element is actually added, we can prevent unnecessary writes and preserve comments/formatting in already-clean tsconfig.json files.

Suggested change
function addManagedIncludesForFrameworkProject(settings: TsConfigJson): void {
// Omitting include lets framework tsconfigs keep TypeScript's default
// "all TS/TSX files" behavior, which already covers scripts.
// "all TS/TSX files" behavior, which already covers both paths.
if (!settings.include) return;
if (settings.include.includes('scripts/**/*')) return;
settings.include.push('scripts/**/*');
for (const managedInclude of ['*.config.ts', 'scripts/**/*']) {
if (!settings.include.includes(managedInclude)) settings.include.push(managedInclude);
}
settings.include.sort();
}
function addManagedIncludesForFrameworkProject(settings: TsConfigJson): void {\n // Omitting include lets framework tsconfigs keep TypeScript's default\n // \"all TS/TSX files\" behavior, which already covers both paths.\n if (!settings.include) return;\n\n let added = false;\n for (const managedInclude of ['*.config.ts', 'scripts/**/*']) {\n if (!settings.include.includes(managedInclude)) {\n settings.include.push(managedInclude);\n added = true;\n }\n }\n if (added) {\n settings.include.sort();\n }\n}
References
  1. Simplify code as much as possible to eliminate redundancy. (link)

Keep legacy configs when managed blocks are incomplete, document and log
canonical config replacement, and ensure framework projects type generated
tool configs without needless JSONC rewrites.
@exKAZUu exKAZUu closed this Sep 4, 2026
@exKAZUu
exKAZUu deleted the fix/wbfy-legacy-oxfmt branch September 4, 2026 09:22
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.

1 participant