From dd03c290c5398bbaf108a51374a5b8e640e1f815 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 7 Mar 2019 12:10:37 +0800 Subject: [PATCH] Merge pull request #5929 from dfee/patch-3 updated docs to reflect proper params passed to webpack.config.js --- .../configurations/typescript-config/index.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/src/pages/configurations/typescript-config/index.md b/docs/src/pages/configurations/typescript-config/index.md index 5ae2a0d7306..d2c5ed00220 100644 --- a/docs/src/pages/configurations/typescript-config/index.md +++ b/docs/src/pages/configurations/typescript-config/index.md @@ -30,20 +30,20 @@ module.exports = ({ config, mode }) => { test: /\.(ts|tsx)$/, use: [ { - loader: require.resolve('awesome-typescript-loader') + loader: require.resolve('awesome-typescript-loader'), }, // Optional { - loader: require.resolve('react-docgen-typescript-loader') - } - ] + loader: require.resolve('react-docgen-typescript-loader'), + }, + ], }); config.resolve.extensions.push('.ts', '.tsx'); return config; }; ``` -The above example shows a working Webpack config with the [TSDocgen plugin](https://github.com/strothj/react-docgen-typescript-loader) integrated. This plugin is not necessary to use Storybook and the section marked `// optional` can be safely removed if the features of TSDocgen are not required. +The above example shows a working Webpack config with the [TSDocgen plugin](https://github.com/strothj/react-docgen-typescript-loader) integrated. This plugin is not necessary to use Storybook and the section marked `// optional` can be safely removed if the features of TSDocgen are not required. ### `tsconfig.json` @@ -100,8 +100,8 @@ module.exports = ({ config, mode }) => { test: /\.(ts|tsx)$/, loader: require.resolve('babel-loader'), options: { - presets: [['react-app', { flow: false, typescript: true }]] - } + presets: [['react-app', { flow: false, typescript: true }]], + }, }); config.resolve.extensions.push('.ts', '.tsx'); return config; @@ -154,8 +154,8 @@ Please refer to the [react-docgen-typescript-loader](https://github.com/strothj/ Additional annotation can be achieved by setting a default set of info parameters: ```ts -import {addDecorator} from "@storybook/react"; -import {withInfo} from "@storybook/addon-info"; +import { addDecorator } from '@storybook/react'; +import { withInfo } from '@storybook/addon-info'; // Globally in your .storybook/config.js, or alternatively, per-chapter addDecorator(