Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1268743

Browse files
authored
fix: stricter types (storybookjs#562)
1 parent 4864c24 commit 1268743

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

‎examples/expo-example/App.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import App from './App';
66
describe('<App />', () => {
77
it('has 1 child', () => {
88
const tree = renderer.create(<App />).toJSON();
9-
if (!Array.isArray(tree) && tree.children) {
9+
if (!Array.isArray(tree) && tree?.children) {
1010
expect(tree.children.length).toBe(1);
1111
} else {
1212
throw new Error('App has no children');

‎examples/expo-example/tsconfig.json‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"compilerOptions": {
33
"skipLibCheck": true,
44
"lib": ["es6"],
5-
"baseUrl": "./"
5+
"baseUrl": "./",
6+
"strict": true
67
},
7-
"extends": "expo/tsconfig.base"
8+
"extends": "expo/tsconfig.base",
9+
"include": ["./.storybook/", "./.storybook-web/", "./*"]
810
}

‎packages/react-native/src/Start.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ import { PreviewWithSelection } from '@storybook/preview-api/dist/preview-web';
1010
import { createBrowserChannel } from '@storybook/channels';
1111
import { View } from './View';
1212
import type { ReactRenderer } from '@storybook/react';
13-
import type { NormalizedStoriesSpecifier } from '@storybook/types';
13+
import type { NormalizedStoriesSpecifier, StoryIndex } from '@storybook/types';
1414

1515
export function prepareStories({
1616
storyEntries,
1717
}: {
1818
storyEntries: Array<NormalizedStoriesSpecifier & { req: any }>;
1919
}) {
20-
let index = {
20+
let index: StoryIndex = {
2121
v: 4,
2222
entries: {},
2323
};
2424

25-
let importMap = {};
25+
let importMap: Record<string, any> = {};
2626

2727
const makeTitle = (
2828
fileName: string,

0 commit comments

Comments
 (0)