fix: resolve TypeScript 6 deprecation errors in tsconfig files#7285
Conversation
- Remove deprecated `baseUrl: "."` from tsconfig.base.json and www/tsconfig.json (baseUrl is deprecated in TS6; paths with relative values work without it under moduleResolution: bundler, and there were no paths relying on it in base) - Remove deprecated `allowSyntheticDefaultImports: false` from tsconfig.json (deprecated in TS6; CommonJS module mode already defaults to false) - Add explicit `rootDir: "./src"` to tsconfig.json (required by TS6 when outDir/declarationDir are set) - Add storybook/css.d.ts ambient CSS module declaration (TS6 adds noUncheckedSideEffectImports to strict mode, requiring type declarations for CSS side-effect imports in the Vite-bundled storybook) Verified: `npm run check-types` passes with zero errors under TypeScript 6.0.3 and continues to pass under TypeScript 5.9.3. Closes recharts#7253
WalkthroughUpdates TypeScript configuration for compatibility with TypeScript 6. Changes include removing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/snapshots/markdownFiles.txt`:
- Line 4: The snapshot lists "CLAUDE.md" but that file is missing, causing
globSync('*.md') snapshot mismatches; either remove the "CLAUDE.md" entry from
scripts/snapshots/markdownFiles.txt or add a CLAUDE.md file to the repository
root so the snapshot matches actual files, and update the PR description to
explicitly state how this snapshot change relates to the TypeScript 6
deprecation fixes (e.g., note it's an unrelated snapshot clean-up or explain why
the new file is needed for TS6 compatibility).
🪄 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: e875302c-a132-4f55-8b8a-f4dfd60ba1d9
📒 Files selected for processing (5)
scripts/snapshots/markdownFiles.txtstorybook/css.d.tstsconfig.base.jsontsconfig.jsonwww/tsconfig.json
💤 Files with no reviewable changes (2)
- www/tsconfig.json
- tsconfig.base.json
|
@PavelVanecek Would you mind taking a loot at this PR along with recharts/recharts-integ#93 ? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7285 +/- ##
==========================================
- Coverage 89.08% 89.05% -0.04%
==========================================
Files 541 541
Lines 41069 41088 +19
Branches 5564 5563 -1
==========================================
+ Hits 36588 36589 +1
- Misses 4473 4491 +18
Partials 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
baseUrl: "."from tsconfig.base.json and www/tsconfig.json (baseUrl is deprecated in TS6; paths with relative values work without it under moduleResolution: bundler, and there were no paths relying on it in base)allowSyntheticDefaultImports: falsefrom tsconfig.json (deprecated in TS6; CommonJS module mode already defaults to false)rootDir: "./src"to tsconfig.json (required by TS6 when outDir/declarationDir are set)Verified:
npm run check-typespasses with zero errors under TypeScript 6.0.3 and continues to pass under TypeScript 5.9.3.Related Issue
Closes #7253
How Has This Been Tested?
This is tested through recharts/recharts-integ#93
Screenshots (if appropriate):
Types of changes
Checklist: