|
1 | | -import type { StorybookConfig } from "@storybook/react-vite"; |
| 1 | +import type { StorybookConfig } from '@storybook/react-vite'; |
2 | 2 |
|
3 | | -import { join, dirname } from "path"; |
| 3 | +import { join, dirname } from 'path'; |
4 | 4 |
|
5 | 5 | /** |
6 | 6 | * This function is used to resolve the absolute path of a package. |
7 | 7 | * It is needed in projects that use Yarn PnP or are set up within a monorepo. |
8 | 8 | */ |
| 9 | +// getAbsolutePath use internal types of storybook : "FrameworkName" |
| 10 | +// eslint-disable-next-line @typescript-eslint/no-explicit-any |
9 | 11 | function getAbsolutePath(value: string): any { |
10 | | - return dirname(require.resolve(join(value, "package.json"))); |
| 12 | + return dirname(require.resolve(join(value, 'package.json'))); |
11 | 13 | } |
12 | 14 |
|
13 | 15 | const config: StorybookConfig = { |
14 | | - stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], |
| 16 | + stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], |
15 | 17 | addons: [ |
16 | | - getAbsolutePath("@storybook/addon-interactions"), |
17 | | - getAbsolutePath("@storybook/addon-links"), |
18 | | - getAbsolutePath("@storybook/addon-essentials"), |
19 | | - getAbsolutePath("@storybook/addon-onboarding"), |
| 18 | + getAbsolutePath('@storybook/addon-interactions'), |
| 19 | + getAbsolutePath('@storybook/addon-links'), |
| 20 | + getAbsolutePath('@storybook/addon-essentials'), |
| 21 | + getAbsolutePath('@storybook/addon-onboarding'), |
20 | 22 | ], |
21 | 23 | framework: { |
22 | | - name: getAbsolutePath("@storybook/react-vite"), |
| 24 | + name: getAbsolutePath('@storybook/react-vite'), |
23 | 25 | options: {}, |
24 | 26 | }, |
25 | 27 | docs: { |
26 | | - autodocs: "tag", |
| 28 | + autodocs: 'tag', |
27 | 29 | }, |
28 | 30 | }; |
29 | 31 | export default config; |
0 commit comments