Skip to content

Commit

Permalink
chore(storybook): enable strict mode (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
100terres committed Aug 21, 2022
1 parent 2d6fba4 commit 7106efa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 126 deletions.
9 changes: 4 additions & 5 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
require('dotenv').config();

module.exports = {
addons: [
'@storybook/addon-essentials',
'@storybook/addon-storysource',
'storybook-addon-performance/register',
],
addons: ['@storybook/addon-essentials', '@storybook/addon-storysource'],
check: true,
checkOptions: {
tsconfig: '../stories/tsconfig.json',
},
core: {
disableTelemetry: true,
},
reactOptions: {
strictMode: true,
},
stories: [
'../stories/**/*.stories.mdx',
'../stories/**/*.stories.@(js|jsx|ts|tsx)',
Expand Down
15 changes: 5 additions & 10 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
import '@atlaskit/css-reset';

import { DecoratorFn } from '@storybook/react';
import React from 'react';
import { withPerformance } from 'storybook-addon-performance';
import { resetData } from '../stories/src/data';
import GlobalStyles from './custom-decorators/global-styles';
import welcomeMessage from './welcome-message';

welcomeMessage();

export const decorators = [
(Story: React.ElementType, { id }: { id: string }) => {
export const decorators: DecoratorFn[] = [
(story, { id }: { id: string }) => {
resetData(id);

return <Story key={id} />;
return story({ key: id });
},
(Story: React.ElementType): React.ReactElement => (
<GlobalStyles>
<Story />
</GlobalStyles>
),
withPerformance,
(story) => <GlobalStyles>{story()}</GlobalStyles>,
];

export const parameters = {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@
"rollup-plugin-size-snapshot": "0.12.0",
"rollup-plugin-terser": "7.0.2",
"seedrandom": "3.0.5",
"storybook-addon-performance": "0.16.1",
"styled-components": "5.3.5",
"stylelint": "14.6.1",
"stylelint-config-prettier": "9.0.3",
Expand Down
112 changes: 2 additions & 110 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7106efa

Please sign in to comment.