feat: bump packages, move to tsgo and oxc#19
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe changes migrate the linting and formatting toolchain from ESLint/Prettier to Oxlint/Oxfmt, add new tool configuration files, remove legacy configurations, update package.json scripts and dependencies, and apply minor formatting adjustments across source files. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19 +/- ##
===========================================
+ Coverage 55.12% 76.74% +21.61%
===========================================
Files 7 4 -3
Lines 156 43 -113
Branches 20 17 -3
===========================================
- Hits 86 33 -53
+ Misses 69 8 -61
- Partials 1 2 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
package.json (1)
1-53:⚠️ Potential issue | 🔴 CriticalCI blocker:
pnpm-lock.yamlis out of sync withpackage.json.Both CI jobs fail with
ERR_PNPM_OUTDATED_LOCKFILE— the lockfile still referencestypescript@^6.0.3which has been removed in this PR (replaced by@typescript/native-previewfortsgo). Runpnpm installlocally and commit the updatedpnpm-lock.yaml.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` around lines 1 - 53, The CI is failing due to an out-of-date pnpm lockfile that still pins typescript@^6.0.3 while package.json replaced it with `@typescript/native-preview` for tsgo; run pnpm install locally to regenerate pnpm-lock.yaml (ensuring package.json's dependencies and peerDependencies like "@typescript/native-preview", "tsgo", and "@types/node" are reflected), commit the updated pnpm-lock.yaml, and push the change so CI no longer errors with ERR_PNPM_OUTDATED_LOCKFILE.src/renderers/swagger.ts (1)
34-34:⚠️ Potential issue | 🟡 MinorChange
layout2tolayout.Swagger UI's config key is
layout, notlayout2. The incorrect key preventsStandaloneLayoutfrom being applied, causing Swagger UI to fall back to the default layout. Fix this typo:- layout2: "StandaloneLayout", + layout: "StandaloneLayout",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/renderers/swagger.ts` at line 34, The Swagger UI config object uses the wrong property name 'layout2' which prevents applying StandaloneLayout; rename the property 'layout2' to 'layout' in the Swagger UI configuration (the object where layout2: "StandaloneLayout" is set) so it reads layout: "StandaloneLayout" to correctly apply the StandaloneLayout.
🧹 Nitpick comments (3)
src/renderers/scalar.ts (1)
9-12:satisfiesconstraint losesurltype safety.Using
{ url?: string }(optional) in thesatisfiesconstraint allows the object to still type-check even ifurlwere removed or misspelled. Sinceurl: opts.specis always set here, consider making it required so accidental removal is caught at compile time:- } satisfies Partial<ScalarConfig> & { url?: string }; + } satisfies Partial<ScalarConfig> & { url: string | undefined };Minor nit; the behavior at runtime is unchanged.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/renderers/scalar.ts` around lines 9 - 12, The satisfies constraint on scalarConfig currently uses Partial<ScalarConfig> & { url?: string } which makes url optional and won't catch accidental removal; update the constraint to require url (e.g., Partial<ScalarConfig> & { url: string }) so the compiler enforces that url (assigned from opts.spec) is present, and verify scalarConfig and any uses still type-check with the stricter { url: string } requirement..oxlintrc.json (1)
1-5: Consider making the ruleset configuration explicit for clarity.Oxlint enables the
correctnesscategory by default, which provides high-signal checks for incorrect/unsafe code. However, with"rules": {}and no explicitcategoriesconfiguration, this behavior is implicit. For better documentation and control, consider explicitly configuring categories (e.g.,"categories": { "correctness": "error", "suspicious": "warn" }) to make your lint surface clear and maintainable. This is especially useful if you want to include rules beyondcorrectness, such assuspiciousor other categories.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.oxlintrc.json around lines 1 - 5, The config currently leaves "rules": {} without explicit categories; add a "categories" key to the JSON and explicitly set desired category severities (e.g., set "correctness": "error" and "suspicious": "warn") so the linter behavior is documented and controlled; update the same JSON object that contains "plugins" and "rules" to include the new "categories" property with those values.package.json (1)
34-34: Remove unusedeslint-config-unjsfrom devDependencies.The package.json shows that the linting setup has fully migrated to
oxlintandoxfmt(scripts on lines 19–20, dependencies on lines 36–37), andeslint.config.mjshas been removed.eslint-config-unjsis no longer referenced anywhere in the codebase and should be removed from line 34.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` at line 34, Remove the unused devDependency "eslint-config-unjs" from package.json's devDependencies section: delete the "eslint-config-unjs": "^0.6.2" entry, run your package manager to update lockfiles (npm/yarn/pnpm install), and verify no references remain (search for "eslint-config-unjs" or eslint.config.mjs) so that linting now relies solely on the existing "oxlint"/"oxfmt" setup.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 30: Add a short documented migration plan in the repository (e.g., a new
docs/ or a README section) that explains replacing the pinned
"@typescript/native-preview" dependency with the stable "typescript" package
when TypeScript 7.0 is released, include a timeline/trigger (release date or
semver tag), the exact steps to update package.json and run npm/yarn to
reinstall, and update the npm script named "test:types" to reference the stable
"typescript" package; also add a one-line TODO comment in package.json near
"@typescript/native-preview" pointing to the new doc and create a task/issue
tracking this migration.
---
Outside diff comments:
In `@package.json`:
- Around line 1-53: The CI is failing due to an out-of-date pnpm lockfile that
still pins typescript@^6.0.3 while package.json replaced it with
`@typescript/native-preview` for tsgo; run pnpm install locally to regenerate
pnpm-lock.yaml (ensuring package.json's dependencies and peerDependencies like
"@typescript/native-preview", "tsgo", and "@types/node" are reflected), commit
the updated pnpm-lock.yaml, and push the change so CI no longer errors with
ERR_PNPM_OUTDATED_LOCKFILE.
In `@src/renderers/swagger.ts`:
- Line 34: The Swagger UI config object uses the wrong property name 'layout2'
which prevents applying StandaloneLayout; rename the property 'layout2' to
'layout' in the Swagger UI configuration (the object where layout2:
"StandaloneLayout" is set) so it reads layout: "StandaloneLayout" to correctly
apply the StandaloneLayout.
---
Nitpick comments:
In @.oxlintrc.json:
- Around line 1-5: The config currently leaves "rules": {} without explicit
categories; add a "categories" key to the JSON and explicitly set desired
category severities (e.g., set "correctness": "error" and "suspicious": "warn")
so the linter behavior is documented and controlled; update the same JSON object
that contains "plugins" and "rules" to include the new "categories" property
with those values.
In `@package.json`:
- Line 34: Remove the unused devDependency "eslint-config-unjs" from
package.json's devDependencies section: delete the "eslint-config-unjs":
"^0.6.2" entry, run your package manager to update lockfiles (npm/yarn/pnpm
install), and verify no references remain (search for "eslint-config-unjs" or
eslint.config.mjs) so that linting now relies solely on the existing
"oxlint"/"oxfmt" setup.
In `@src/renderers/scalar.ts`:
- Around line 9-12: The satisfies constraint on scalarConfig currently uses
Partial<ScalarConfig> & { url?: string } which makes url optional and won't
catch accidental removal; update the constraint to require url (e.g.,
Partial<ScalarConfig> & { url: string }) so the compiler enforces that url
(assigned from opts.spec) is present, and verify scalarConfig and any uses still
type-check with the stricter { url: string } requirement.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0e57a322-17d3-42cd-9e86-b7b776f9c13f
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
.oxfmtrc.json.oxlintrc.json.prettierignore.prettierrceslint.config.mjspackage.jsonsrc/render.tssrc/renderers/kong.tssrc/renderers/scalar.tssrc/renderers/swagger.ts
💤 Files with no reviewable changes (3)
- .prettierrc
- .prettierignore
- eslint.config.mjs
Bump packages to newest versions, move to tsgo and oxc (lint + fmt)
Summary by CodeRabbit
Chores
pnpm-lock.yamlis now included in formatting.Style