Skip to content

fix: resolve TypeScript 6 deprecation errors in tsconfig files#7285

Merged
PavelVanecek merged 2 commits into
recharts:mainfrom
shreedharbhat98:feat/typescript-6-compat
Apr 29, 2026
Merged

fix: resolve TypeScript 6 deprecation errors in tsconfig files#7285
PavelVanecek merged 2 commits into
recharts:mainfrom
shreedharbhat98:feat/typescript-6-compat

Conversation

@shreedharbhat98

@shreedharbhat98 shreedharbhat98 commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Description

  • 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.

Related Issue

Closes #7253

How Has This Been Tested?

This is tested through recharts/recharts-integ#93

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a storybook story or VR test, or extended an existing story or VR test to show my changes

- 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
@shreedharbhat98
shreedharbhat98 marked this pull request as draft April 29, 2026 05:21
@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Updates TypeScript configuration for compatibility with TypeScript 6. Changes include removing baseUrl from shared and www configs, modifying main tsconfig with rootDir and removing allowSyntheticDefaultImports, adding CSS module type declarations to Storybook, and updating markdown snapshot file list.

Changes

Cohort / File(s) Summary
TypeScript Configuration
tsconfig.base.json, tsconfig.json, www/tsconfig.json
Removes compilerOptions.baseUrl from base and www configs; updates main tsconfig to add rootDir: "./src" and remove allowSyntheticDefaultImports.
Type Declarations
storybook/css.d.ts
Adds ambient module declaration declare module '*.css'; to enable TypeScript compilation of CSS imports.
Snapshot Files
scripts/snapshots/markdownFiles.txt
Adds CLAUDE.md to the list of tracked markdown files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • ckifer
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive All changes are directly scoped to resolving TypeScript 6 deprecation issues; the snapshot file addition (markdownFiles.txt) appears incidental to tracking generated artifacts. Clarify whether the markdownFiles.txt change for CLAUDE.md is necessary for the TypeScript 6 compatibility objective or if it should be addressed separately.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: resolving TypeScript 6 deprecation errors in tsconfig files, which accurately reflects all five file modifications.
Linked Issues check ✅ Passed The PR addresses TypeScript 6 compatibility by fixing deprecation errors in tsconfig files, directly meeting the issue #7253 requirement to confirm TypeScript 6 compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is comprehensive and well-structured, following the template with all required sections completed including description, related issue, testing details, and type classification.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 42990a0 and 9b88745.

📒 Files selected for processing (5)
  • scripts/snapshots/markdownFiles.txt
  • storybook/css.d.ts
  • tsconfig.base.json
  • tsconfig.json
  • www/tsconfig.json
💤 Files with no reviewable changes (2)
  • www/tsconfig.json
  • tsconfig.base.json

Comment thread scripts/snapshots/markdownFiles.txt Outdated
@shreedharbhat98
shreedharbhat98 marked this pull request as ready for review April 29, 2026 05:42
@shreedharbhat98

Copy link
Copy Markdown
Contributor Author

@PavelVanecek Would you mind taking a loot at this PR along with recharts/recharts-integ#93 ?

@codecov

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.05%. Comparing base (839f5c5) to head (1f59f51).
⚠️ Report is 5 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PavelVanecek
PavelVanecek merged commit f8281a8 into recharts:main Apr 29, 2026
98 of 99 checks passed
@shreedharbhat98
shreedharbhat98 deleted the feat/typescript-6-compat branch April 29, 2026 13:27
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.

Typescript 6

2 participants