fix(chart): proper recharts 3 types without any - #49
Conversation
- 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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedNext included review available in 30 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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 |
✅MegaLinter analysis: Success
Notices
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
|

Description
Follow-up to #48 — replaces the
any+eslint-disableworkaround with properrecharts@3types.ChartTooltipContentnow usesTooltipContentProps<number,string>(payload/label via context, notTooltipProps)ChartLegendContentusesLegendPayload[]fromrecharts(DefaultLegendContentProps,LegendPropsomits payload)key={String(dataKey ?? name ?? index)}handlesDataKeyfunction caseformattercast viaunknownforValueType/NameTypecompatibility, noanyeslint-disable,pnpm type-checkandeslint --max-warnings=0passType of Change
How Has This Been Tested?
pnpm type-check—tsc --noEmitclean (was 8 errors, then 2 withanyfix)pnpm exec eslint src/components/ui/chart.tsx --max-warnings=0— passpnpm test --run— 16 tests passedpnpm audit— 0 vulnerabilitiesChecklist