Skip to content

fix(chart): proper recharts 3 types without any - #49

Merged
ulises-jeremias merged 1 commit into
mainfrom
fix/chart-proper-types
Aug 27, 2026
Merged

fix(chart): proper recharts 3 types without any#49
ulises-jeremias merged 1 commit into
mainfrom
fix/chart-proper-types

Conversation

@ulises-jeremias

Copy link
Copy Markdown
Member

Description

Follow-up to #48 — replaces the any + eslint-disable workaround with proper recharts@3 types.

  • ChartTooltipContent now uses TooltipContentProps<number,string> (payload/label via context, not TooltipProps)
  • ChartLegendContent uses LegendPayload[] from recharts (DefaultLegendContentProps, LegendProps omits payload)
  • key={String(dataKey ?? name ?? index)} handles DataKey function case
  • formatter cast via unknown for ValueType/NameType compatibility, no any
  • No eslint-disable, pnpm type-check and eslint --max-warnings=0 pass

Type of Change

  • Bug fix
  • New feature
  • Breaking change

How Has This Been Tested?

  • pnpm type-checktsc --noEmit clean (was 8 errors, then 2 with any fix)
  • pnpm exec eslint src/components/ui/chart.tsx --max-warnings=0 — pass
  • pnpm test --run — 16 tests passed
  • pnpm audit — 0 vulnerabilities

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

- use TooltipContentProps/LegendPayload from recharts
- String(dataKey) for Key, cast formatter via unknown
- no eslint-disable, strict types pass

Follow-up to #48 which used any + eslint-disable
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
create-awesome-python-app-website Ready Ready Preview Aug 27, 2026 3:52am

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 30 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 67df72e4-72ea-4373-8a63-5b91bdcac15c

📥 Commits

Reviewing files that changed from the base of the PR and between ddc5853 and 590f556.

📒 Files selected for processing (1)
  • src/components/ui/chart.tsx

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.

@github-actions

Copy link
Copy Markdown
Contributor
Messages
📖 Thanks! We ❤️ small PRs!

Generated by 🚫 dangerJS against 590f556

@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 5 0 0 0.09s
✅ COPYPASTE jscpd yes no no 0.94s
✅ EDITORCONFIG editorconfig-checker 172 0 0 0.45s
✅ JAVASCRIPT standard 1 0 0 1.95s
✅ JSON jsonlint 9 0 0 0.19s
✅ JSON npm-package-json-lint yes no no 0.54s
✅ JSON prettier 9 0 0 0.52s
✅ JSON v8r 9 0 0 12.95s
✅ MARKDOWN markdownlint 9 0 0 1.02s
✅ MARKDOWN markdown-table-formatter 9 0 0 0.34s
✅ REPOSITORY betterleaks yes no no 0.9s
✅ REPOSITORY checkov yes no no 17.26s
✅ REPOSITORY git_diff yes no no 0.02s
✅ REPOSITORY osv-scanner yes no no 1.56s
✅ REPOSITORY secretlint yes no no 2.4s
✅ REPOSITORY trivy yes no no 10.96s
✅ REPOSITORY trufflehog yes no no 3.88s
✅ SPELL cspell 173 0 0 4.48s
✅ YAML prettier 13 0 0 0.75s
✅ YAML yamllint 13 0 0 0.8s

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: MARKDOWN_MARKDOWN_LINK_CHECK. See Removed linters to find their replacements.

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.0.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,COPYPASTE_JSCPD,EDITORCONFIG_EDITORCONFIG_CHECKER,JAVASCRIPT_STANDARD,JSON_JSONLINT,JSON_V8R,JSON_PRETTIER,JSON_NPM_PACKAGE_JSON_LINT,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_TRIVY,REPOSITORY_TRUFFLEHOG,SPELL_CSPELL,YAML_PRETTIER,YAML_YAMLLINT

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@ulises-jeremias
ulises-jeremias merged commit 4755c43 into main Aug 27, 2026
9 checks passed
@ulises-jeremias
ulises-jeremias deleted the fix/chart-proper-types branch August 27, 2026 03:57
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