Problem
TooltipIndex is currently being imported from an internal implementation path:
import { TooltipIndex } from 'recharts/types/state/tooltipSlice';
This path references internal implementation details that are not part of the stable public API. While the type appears in published type definitions, it is not exported from the main package entry points (recharts).
Proposed Solution
-
Export TooltipIndex from public API: Re-export TooltipIndex from the main package entry point (src/index.ts) to make it part of the stable public API.
-
Add ESLint rule: Implement an ESLint rule to prevent imports from internal paths like recharts/types/state/* to avoid regressions in the future. The rule should enforce that all imports from recharts use only the public entry point src/index.ts.
Context
This issue was identified in PR #6669 where multiple example components import TooltipIndex from the internal path:
www/src/docs/exampleComponents/ScatterChart/BubbleChart.tsx
www/src/docs/exampleComponents/ScatterChart/JointLineScatterChart.tsx
www/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsx
www/src/docs/exampleComponents/ScatterChart/SimpleScatterChart.tsx
www/src/docs/exampleComponents/ScatterChart/ThreeDimScatterChart.tsx
Related PR: #6669
Comment thread: #6669 (comment)
Acceptance Criteria
cc @PavelVanecek
Problem
TooltipIndexis currently being imported from an internal implementation path:This path references internal implementation details that are not part of the stable public API. While the type appears in published type definitions, it is not exported from the main package entry points (
recharts).Proposed Solution
Export
TooltipIndexfrom public API: Re-exportTooltipIndexfrom the main package entry point (src/index.ts) to make it part of the stable public API.Add ESLint rule: Implement an ESLint rule to prevent imports from internal paths like
recharts/types/state/*to avoid regressions in the future. The rule should enforce that all imports fromrechartsuse only the public entry pointsrc/index.ts.Context
This issue was identified in PR #6669 where multiple example components import
TooltipIndexfrom the internal path:www/src/docs/exampleComponents/ScatterChart/BubbleChart.tsxwww/src/docs/exampleComponents/ScatterChart/JointLineScatterChart.tsxwww/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsxwww/src/docs/exampleComponents/ScatterChart/SimpleScatterChart.tsxwww/src/docs/exampleComponents/ScatterChart/ThreeDimScatterChart.tsxRelated PR: #6669
Comment thread: #6669 (comment)
Acceptance Criteria
TooltipIndexis exported from a public entry pointcc @PavelVanecek