Skip to content

Commit

Permalink
chore: upgrade storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwalley committed Dec 27, 2023
1 parent a3d4bb5 commit fbbf09c
Show file tree
Hide file tree
Showing 5 changed files with 11,670 additions and 14,173 deletions.
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"extends": ["plugin:react-hooks/recommended", "prettier"],
"extends": [
"plugin:react-hooks/recommended",
"prettier",
"plugin:storybook/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": ["simple-import-sort"],
"plugins": [
"simple-import-sort"
],
"rules": {
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn"
Expand Down
13 changes: 9 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
const path = require("path");

module.exports = {
core: {
builder: "webpack5",
},
stories: [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)",
],

addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"storybook-dark-mode",
],

features: {
postcss: false,
},

framework: {
name: "@storybook/react-webpack5",
options: {},
},

webpackFinal: async (baseConfig, options) => {
// Modify or replace config. Mutating the original reference object can cause unexpected bugs.
const { module = {} } = baseConfig;
Expand All @@ -39,7 +40,7 @@ module.exports = {

// First we prevent webpack from using Storybook CSS rules to process CSS modules
newConfig.module.rules.find(
(rule) => rule.test.toString() === "/\\.css$/"
(rule) => rule.test.toString() === "/\\.css$/",
).exclude = /\.module\.css$/;

// Then we tell webpack what to do with CSS modules
Expand All @@ -63,4 +64,8 @@ module.exports = {

return newConfig;
},

docs: {
autodocs: false,
},
};
Loading

0 comments on commit fbbf09c

Please sign in to comment.