-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve eslint, sb, tsc configs (#483)
Summary: This commit is a bit of a shotgun fix for various project settings. Realistically, they could've been separate commits, but this is convenience for just getting things into a green state to unblock further work. Details: - Use our version of TS in vscode plugins - organize vscode/settings.json - fix tsconfig.test and tsconfig.prod (removes errors in test files) - only use prod tsconfig in webpack - point .eslintrc to both test and prod configs - cleanup storybook - running eslint in my workspace was OOMing. I configured maxWorkers like we had in v1 to fix this. - remove .storybook from code coverage - remove .js files from code coverage --> after moving away from Next.js, we don't allowJS in our tsconfig anymore. We only use JS for configurations, it's not allowed in src code!
- Loading branch information
G r e y
committed
Mar 18, 2022
1 parent
d875298
commit 8fde3ed
Showing
12 changed files
with
86 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"], | ||
|
||
// 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 | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters