Skip to content

Commit 1a4df6c

Browse files
authored
Merge pull request #3533 from clairep94/claire/pr05/set_up_ts_dependencies
pr05 Typescript #1: Set up TS dependencies
2 parents f381dea + 1ecafb3 commit 1a4df6c

File tree

13 files changed

+1144
-1676
lines changed

13 files changed

+1144
-1676
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"presets": [
33
"@babel/preset-react",
4-
"@babel/preset-env"
4+
"@babel/preset-env",
5+
"@babel/preset-typescript"
56
],
67
"env": {
78
"production": {

.eslintrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@
8585
},
8686
"overrides": [
8787
{
88-
"files": ["*.stories.jsx"],
88+
"files": ["*.ts", "*.tsx"],
89+
"parser": "@typescript-eslint/parser",
90+
"plugins": ["@typescript-eslint"]
91+
},
92+
{
93+
"files": ["*.stories.@(js|jsx|ts|tsx)"],
8994
"rules": {
9095
"import/no-extraneous-dependencies": "off"
9196
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ terraform/.terraform/
2121
storybook-static
2222
duplicates.json
2323

24-
coverage
24+
coverage
25+
26+
*.tsbuildinfo

.storybook/main.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
22
const config = {
3-
stories: ['../client/**/*.stories.(jsx|mdx)'],
3+
stories: ['../client/**/*.stories.(jsx|mdx|tsx)'],
44
addons: [
55
'@storybook/addon-links',
66
'@storybook/addon-essentials',
@@ -18,19 +18,19 @@ const config = {
1818
// https://storybook.js.org/docs/react/builders/webpack
1919
// this modifies the existing image rule to exclude .svg files
2020
// since we want to handle those files with @svgr/webpack
21-
const imageRule = config.module.rules.find(rule => rule.test.test('.svg'))
22-
imageRule.exclude = /\.svg$/
21+
const imageRule = config.module.rules.find((rule) =>
22+
rule.test.test('.svg')
23+
);
24+
imageRule.exclude = /\.svg$/;
2325

2426
// configure .svg files to be loaded with @svgr/webpack
2527
config.module.rules.push({
2628
test: /\.svg$/,
2729
use: ['@svgr/webpack']
28-
})
30+
});
2931

30-
return config
31-
},
32+
return config;
33+
}
3234
};
3335

3436
export default config;
35-
36-

client/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../tsconfig.base.json",
3+
"compilerOptions": {
4+
"target": "ES6",
5+
"module": "ESNext",
6+
"lib": ["DOM", "ESNext"],
7+
"jsx": "react",
8+
},
9+
}

0 commit comments

Comments
 (0)