Skip to content

Commit

Permalink
chore(storybook): add storybook via npx storybook@latest init
Browse files Browse the repository at this point in the history
  • Loading branch information
4erkashin committed Apr 12, 2023
1 parent 8de8ccb commit f3be14b
Show file tree
Hide file tree
Showing 7 changed files with 9,400 additions and 1,280 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:storybook/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
Expand All @@ -35,7 +36,9 @@ module.exports = {
rules: {
'react/jsx-filename-extension': [
1,
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
{
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
],
'import/no-unresolved': 'error',
'import/prefer-default-export': 'off',
Expand Down
17 changes: 17 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { StorybookConfig } from '@storybook/react-vite';
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
docs: {
autodocs: 'tag',
},
};
export default config;
15 changes: 15 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from '@storybook/react';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};

export default preview;
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ To add it to the project I use `npm init @eslint/config` command.

To add it to the project I follow [official guide](https://prettier.io/docs/en/install.html).

### [storybook](https://storybook.js.org/)

Storybook is a tool for building UI components and pages in isolation.

To add it to the project I follow [official guide](https://storybook.js.org/docs/react/get-started/install/).

### npm-check-updates helper

I use this tool weekly to manually update the dependencies
Expand Down
Loading

0 comments on commit f3be14b

Please sign in to comment.