Skip to content

Commit 67340ee

Browse files
committed
chore(deps): bump Storybook version
- added: `.prettierrc` config (based off current style) - added: `eslint-plugin-tailwind` enforce best practices and consistency (auto-format on save)
1 parent e5ab3b5 commit 67340ee

8 files changed

Lines changed: 1372 additions & 4825 deletions

File tree

.eslintrc.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,24 @@ module.exports = {
66
"plugin:@typescript-eslint/recommended",
77
"plugin:react-hooks/recommended",
88
"plugin:storybook/recommended",
9+
"plugin:tailwindcss/recommended",
910
],
1011
ignorePatterns: ["dist", ".eslintrc.cjs"],
1112
parser: "@typescript-eslint/parser",
1213
plugins: ["react-refresh"],
1314
rules: {
15+
"@typescript-eslint/no-unused-vars": [
16+
"error",
17+
{
18+
args: "all",
19+
argsIgnorePattern: "^_",
20+
caughtErrors: "all",
21+
caughtErrorsIgnorePattern: "^_",
22+
destructuredArrayIgnorePattern: "^_",
23+
varsIgnorePattern: "^_",
24+
ignoreRestSiblings: true,
25+
},
26+
],
1427
"react-refresh/only-export-components": [
1528
"warn",
1629
{ allowConstantExport: true },

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ dist-ssr
2424
*.sw?
2525

2626
*storybook.log
27+
storybook-static

.prettierrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
{}
1+
{
2+
"tabWidth": 2,
3+
"semi": true,
4+
}

.storybook/main.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
import type { StorybookConfig } from "@storybook/react-vite";
1+
import type { StorybookConfig } from '@storybook/react-vite'
22

33
const config: StorybookConfig = {
4-
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
4+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
55
addons: [
6-
"@storybook/addon-onboarding",
7-
"@storybook/addon-links",
8-
"@storybook/addon-essentials",
9-
"@chromatic-com/storybook",
10-
"@storybook/addon-interactions",
6+
'@storybook/addon-onboarding',
7+
'@storybook/addon-essentials',
8+
'@chromatic-com/storybook',
9+
'@storybook/addon-interactions',
1110
],
1211
framework: {
13-
name: "@storybook/react-vite",
12+
name: '@storybook/react-vite',
1413
options: {},
1514
},
16-
docs: {
17-
autodocs: "tag",
18-
},
19-
};
20-
export default config;
15+
}
16+
export default config

.storybook/preview.ts

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,45 @@
1-
import "../src/index.css";
2-
import type { Preview } from "@storybook/react";
1+
import '../src/index.css'
2+
3+
import type { Preview } from '@storybook/react'
4+
import { themes } from '@storybook/theming'
5+
import { withThemeByClassName } from '@storybook/addon-themes'
36

47
const preview: Preview = {
8+
globalTypes: {
9+
theme: {
10+
description: 'Global theme for components',
11+
toolbar: {
12+
title: 'Theme',
13+
icon: 'switchalt',
14+
items: ['light', 'dark'],
15+
dynamicTitle: true,
16+
},
17+
},
18+
},
19+
initialGlobals: {
20+
theme: 'dark',
21+
},
522
parameters: {
23+
docs: {
24+
theme: themes.dark,
25+
},
26+
627
controls: {
728
matchers: {
829
color: /(background|color)$/i,
930
date: /Date$/i,
1031
},
1132
},
1233
},
13-
};
34+
decorators: [
35+
withThemeByClassName({
36+
themes: {
37+
light: 'light',
38+
dark: 'dark',
39+
},
40+
defaultTheme: 'dark',
41+
}),
42+
],
43+
}
1444

15-
export default preview;
45+
export default preview

0 commit comments

Comments
 (0)