Skip to content

Commit

Permalink
chore(deps): bump Storybook version
Browse files Browse the repository at this point in the history
- added: `.prettierrc` config (based off current style)
- added: `eslint-plugin-tailwind` enforce best practices and consistency
  (auto-format on save)
  • Loading branch information
pongstr committed Dec 29, 2024
1 parent e5ab3b5 commit 67340ee
Show file tree
Hide file tree
Showing 8 changed files with 1,372 additions and 4,825 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@ module.exports = {
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:storybook/recommended",
"plugin:tailwindcss/recommended",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ dist-ssr
*.sw?

*storybook.log
storybook-static
5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{}
{
"tabWidth": 2,
"semi": true,
}
22 changes: 9 additions & 13 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import type { StorybookConfig } from "@storybook/react-vite";
import type { StorybookConfig } from '@storybook/react-vite'

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
"@storybook/addon-onboarding",
"@storybook/addon-links",
"@storybook/addon-essentials",
"@chromatic-com/storybook",
"@storybook/addon-interactions",
'@storybook/addon-onboarding',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
],
framework: {
name: "@storybook/react-vite",
name: '@storybook/react-vite',
options: {},
},
docs: {
autodocs: "tag",
},
};
export default config;
}
export default config
38 changes: 34 additions & 4 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,45 @@
import "../src/index.css";
import type { Preview } from "@storybook/react";
import '../src/index.css'

import type { Preview } from '@storybook/react'
import { themes } from '@storybook/theming'
import { withThemeByClassName } from '@storybook/addon-themes'

const preview: Preview = {
globalTypes: {
theme: {
description: 'Global theme for components',
toolbar: {
title: 'Theme',
icon: 'switchalt',
items: ['light', 'dark'],
dynamicTitle: true,
},
},
},
initialGlobals: {
theme: 'dark',
},
parameters: {
docs: {
theme: themes.dark,
},

controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};
decorators: [
withThemeByClassName({
themes: {
light: 'light',
dark: 'dark',
},
defaultTheme: 'dark',
}),
],
}

export default preview;
export default preview
Loading

0 comments on commit 67340ee

Please sign in to comment.