Skip to content

Commit d4b11e4

Browse files
authored
Charts: Re-allow typechecking of tests and stories (#45082)
* Remove 'exclude' field from tsconfig to allow typechecking of tests and stories * Add changelog
1 parent eb060f3 commit d4b11e4

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Charts: Allow typechecking of tests and stories

projects/js-packages/charts/src/components/line-chart/stories/tooltip.stories.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import { RenderTooltipParams } from '@visx/xychart/lib/components/Tooltip';
12
import { ChartStoryArgs } from '../../../stories';
3+
import { DataPointDate } from '../../../types';
24
import LineChart from '../line-chart';
35
import { lineChartMetaArgs, lineChartStoryArgs } from './config';
46
import type { Meta, StoryFn, StoryObj } from '@storybook/react';
@@ -57,7 +59,7 @@ CrosshairHorizontal.args = {
5759
export const Custom: StoryObj< typeof LineChart > = Template.bind( {} );
5860
Custom.args = {
5961
...tooltipStoryArgs,
60-
renderTooltip: ( { tooltipData } ) => {
62+
renderTooltip: ( { tooltipData }: RenderTooltipParams< DataPointDate > ) => {
6163
const nearestDatum = tooltipData?.nearestDatum?.datum;
6264
if ( ! nearestDatum ) return null;
6365

projects/js-packages/charts/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
"outDir": "dist",
55
"rootDir": "src"
66
},
7-
"include": [ "src" ],
8-
"exclude": [ "tests", "**/*.test.*", "stories", "**/*.stories.*" ]
7+
"include": [ "src" ]
98
}

0 commit comments

Comments
 (0)