auto-prop-doc
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Storybook + React + TypeScript + Vite

  • Configure the reactDocgenTypescriptOptions property like this on .storybook/main.ts file:
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
  stories: [
    '../src/**/*.mdx',
    '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
  ],
  addons: [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@chromatic-com/storybook",
    "@storybook/addon-interactions",
  ],
  framework: {
    name: "@storybook/react-vite",
    options: {},
  },
  typescript: {
    reactDocgen: 'react-docgen-typescript',
    reactDocgenTypescriptOptions: {
      //👇 Set shouldExtractLiteralValuesFromEnum to true
      shouldExtractLiteralValuesFromEnum: true,
      shouldRemoveUndefinedFromOptional: true,
      skipChildrenPropWithoutDoc: false,
      propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true)
    },
  },
};
export default config;

Readme

Keywords

none

Package Sidebar

Install

npm i auto-prop-doc

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

211 kB

Total Files

15

Last publish

Collaborators

  • dullcrato