Skip to content

Commit

Permalink
Enable type checks for all stories (#2234)
Browse files Browse the repository at this point in the history
Co-authored-by: Rohan <[email protected]>
  • Loading branch information
r100-stack and r100-stack authored Sep 13, 2024
1 parent 4f954e4 commit 5537768
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
10 changes: 5 additions & 5 deletions apps/react-workshop/src/InformationPanel.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import React from 'react';
import { CellProps } from '@itwin/itwinui-react/react-table';
import type { CellProps, Column } from '@itwin/itwinui-react/react-table';
import { SvgEdit } from '@itwin/itwinui-icons-react';
import {
InformationPanel,
Expand Down Expand Up @@ -33,13 +33,13 @@ export const Basic = () => {
{ id: 'name', Header: 'Name', accessor: 'name' },
{
Header: 'Details',
Cell: ({ row: { index } }: CellProps<{ name: string }>) => (
Cell: ({ row: { index } }: CellProps<Record<string, string>>) => (
<Button onClick={() => setOpenRowIndex(index)}>Details</Button>
),
},
],
[],
);
) satisfies Column[];

const data = React.useMemo(
() =>
Expand Down Expand Up @@ -119,7 +119,7 @@ export const Horizontal = () => {
},
],
[],
);
) satisfies Column<{ name: string }>[];

const data = React.useMemo(
() =>
Expand Down Expand Up @@ -192,7 +192,7 @@ export const CustomActions = () => {
},
],
[],
);
) satisfies Column<{ name: string }>[];

const [data, setData] = React.useState(() =>
[...Array(10).fill(null)].map((_, index) => ({
Expand Down
2 changes: 1 addition & 1 deletion apps/react-workshop/src/Select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const Custom = () => {
<Select
options={options}
value={selectedValue}
onChange={setSelectedValue}
onChange={(value) => setSelectedValue(value)}
placeholder='Placeholder text'
itemRenderer={(option) => (
<MenuItem style={{ color: option.value }}>{option.label}</MenuItem>
Expand Down
8 changes: 4 additions & 4 deletions apps/react-workshop/src/TransferList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const Basic = () => {

const transfer = (
fromData: Array<TransferItemDataType>,
setFromData: (data: Array<TransferItemDataType>) => void,
setToData: (data: Array<TransferItemDataType>) => void,
setFromData: React.Dispatch<React.SetStateAction<TransferItemDataType[]>>,
setToData: React.Dispatch<React.SetStateAction<TransferItemDataType[]>>,
sendAll?: boolean,
) => {
setToData((oldToData) => {
Expand Down Expand Up @@ -170,8 +170,8 @@ export const WithLabel = () => {

const transfer = (
fromData: Array<TransferItemDataType>,
setFromData: (data: Array<TransferItemDataType>) => void,
setToData: (data: Array<TransferItemDataType>) => void,
setFromData: React.Dispatch<React.SetStateAction<TransferItemDataType[]>>,
setToData: React.Dispatch<React.SetStateAction<TransferItemDataType[]>>,
sendAll?: boolean,
) => {
setToData((oldToData) => {
Expand Down
8 changes: 2 additions & 6 deletions apps/react-workshop/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.json",
// Temporarily testing only few story files.
// TODO: Fix all tsc errors in all stories and then include all stories.
"include": [],
"files": [
"src/Table.stories.tsx",
"src/Footer.stories.tsx",
"include": [
"./src/**/*.stories.tsx"
],
"compilerOptions": {
"noEmit": true
Expand Down

0 comments on commit 5537768

Please sign in to comment.