refactor: replace deprecated tsconfck with get-tsconfig#4367
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughReplaces the Changestsconfig resolver dependency swap and example updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/config/resolvers/tsconfig.ts (1)
6-11: 💤 Low valueConsider removing
asyncsince function no longer awaits anything.
resolveTsconfigis markedasyncbut performs no asynchronous operations after the refactor. SinceloadTsconfigis now synchronous, theasynckeyword is unnecessary. The callers thatawaitthis function will still work correctly with a sync function.♻️ Suggested cleanup
-export async function resolveTsconfig(options: NitroOptions) { +export function resolveTsconfig(options: NitroOptions) { const root = resolve(options.rootDir || ".") + "/"; if (!options.typescript.tsConfig) { options.typescript.tsConfig = loadTsconfig(root); } }🤖 Prompt for 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. In `@src/config/resolvers/tsconfig.ts` around lines 6 - 11, Remove the `async` keyword from the `resolveTsconfig` function declaration since it no longer contains any await statements after the refactor and `loadTsconfig` is now synchronous. Change the function signature from `export async function resolveTsconfig(options: NitroOptions)` to `export function resolveTsconfig(options: NitroOptions)`. Callers that currently await this function will continue to work correctly with a synchronous function.
🤖 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 `@src/config/resolvers/tsconfig.ts`:
- Around line 19-20: Modify the empty catch block in the tsconfig.ts file to
distinguish between different error types instead of silently handling all
errors with an empty return. Check if the caught error is a "file not found"
error (ENOENT) - if so, silently return the empty object as acceptable fallback.
For other errors like parse errors or permission issues, log a warning message
that includes the error details before returning the empty object. This way,
actual configuration issues are surfaced to the user while gracefully handling
the expected case of a missing tsconfig.json file.
---
Nitpick comments:
In `@src/config/resolvers/tsconfig.ts`:
- Around line 6-11: Remove the `async` keyword from the `resolveTsconfig`
function declaration since it no longer contains any await statements after the
refactor and `loadTsconfig` is now synchronous. Change the function signature
from `export async function resolveTsconfig(options: NitroOptions)` to `export
function resolveTsconfig(options: NitroOptions)`. Callers that currently await
this function will continue to work correctly with a synchronous function.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bd648025-7bfc-4288-b7a5-705f6b65fad5
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
package.jsonsrc/config/resolvers/tsconfig.ts
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 `@examples/vite-ssr-tss-react/package.json`:
- Line 26: The vite-tsconfig-paths dependency has been removed from package.json
but the vite.config.mjs file still contains references to it. In the
vite.config.mjs file, remove the import statement for viteTsConfigPaths at the
top of the file and also remove the viteTsConfigPaths plugin call (with the
projects configuration) from the plugins array in the Vite configuration object
to prevent runtime errors when the module cannot be found.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: da5b30f0-6c3e-4790-bda9-a097ac185ec9
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
docs/4.examples/vite-ssr-tss-react.mdexamples/vite-ssr-tss-react/package.jsonexamples/vite-ssr-tss-react/vite.config.mjssrc/config/resolvers/tsconfig.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/config/resolvers/tsconfig.ts
dominikg/tsconfck#240