-
Notifications
You must be signed in to change notification settings - Fork 886
chore: improve eslint, sb, tsc configs #483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b58e8c3
36f301f
48f60e7
0594fc9
ebf6f06
aab6cec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,5 @@ ignore: | |
- provisionerd/proto | ||
- provisionersdk/proto | ||
- scripts/datadog-cireport | ||
- site/.storybook | ||
- rules.go |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,36 @@ | ||
/** | ||
* @fileoverview This file is configures Storybook | ||
* | ||
* @see <https://storybook.js.org/docs/react/configure/overview> | ||
*/ | ||
const path = require("path") | ||
|
||
module.exports = { | ||
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], | ||
// Automatically loads all stories in source ending in 'stories.tsx' | ||
// | ||
// SEE: https://storybook.js.org/docs/react/configure/overview#configure-story-loading | ||
stories: ["../src/**/*.stories.tsx"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I simplified this for now because:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool! Perhaps worth updating this in v1 also? https://github.com/coder/m/blob/ffc32a2c6e5bb762e58c9cdca30fbd3ce4323886/product/coder/site/.storybook/main.js#L4 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a similar commit in an unpushed branch for v1, yes! Good call! |
||
|
||
// addons are official and community plugins to extend Storybook. | ||
// | ||
// SEE: https://storybook.js.org/addons | ||
addons: ["@storybook/addon-links", "@storybook/addon-essentials"], | ||
|
||
// Storybook uses babel under the hood, while we currently use ts-loader. | ||
// Sometimes, you may encounter an error in a Storybook that contains syntax | ||
// that requires a babel plugin. | ||
// | ||
// SEE: https://storybook.js.org/docs/react/configure/babel | ||
babel: async (options) => ({ | ||
...options, | ||
plugins: ["@babel/plugin-proposal-class-properties"], | ||
// any extra options you want to set | ||
}), | ||
|
||
// Storybook internally uses its own Webpack configuration instead of ours. | ||
// | ||
// SEE: https://storybook.js.org/docs/react/configure/webpack | ||
webpackFinal: async (config) => { | ||
config.resolve.modules = [path.resolve(__dirname, ".."), "node_modules"] | ||
|
||
return config | ||
}, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ Started container user | |
Using user 'coder' with shell '/bin/bash'`.split("\n") | ||
|
||
export default { | ||
title: "CodeBlock", | ||
title: "CodeBlock/CodeBlock", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two types of CodeBlocks, so I organized them. Furthermore, this makes it so that every current story has a top-level heading, which is visually appealing. |
||
component: CodeBlock, | ||
argTypes: { | ||
lines: { control: "text", defaultValue: sampleLines }, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"exclude": ["node_modules", "_jest", "**/*.stories.tsx", "**/*.test.tsx"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"exclude": ["node_modules", "_jest"] | ||
"exclude": ["node_modules", "_jest"], | ||
"include": ["**/*.stories.tsx", "**/*.test.tsx"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was:
tsconfig
files and red squiggly lines showing up in files)