Skip to content

Commit a17a434

Browse files
committed
Typescript setup
1 parent 6266c46 commit a17a434

File tree

17 files changed

+181
-86
lines changed

17 files changed

+181
-86
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"npm-intellisense.importQuotes": "\"",
3+
"typescript.preferences.quoteStyle": "double",
4+
"javascript.preferences.quoteStyle": "double"
5+
}

babel.config.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module.exports = {
2-
presets: ['@babel/preset-env'],
3-
plugins: [
4-
[
5-
'@babel/plugin-proposal-decorators',
6-
{
7-
legacy: true
8-
}
9-
]
10-
]
2+
presets: ['@babel/preset-env'],
3+
plugins: [
4+
[
5+
'@babel/plugin-proposal-decorators',
6+
{
7+
legacy: true,
8+
},
9+
],
10+
],
1111
}

config-overrides.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

jsconfig.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

package-lock.json

Lines changed: 120 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"@testing-library/jest-dom": "^4.2.4",
99
"@testing-library/react": "^9.5.0",
1010
"@testing-library/user-event": "^7.2.1",
11+
"@types/jest": "25.2.1",
12+
"@types/node": "13.11.0",
13+
"@types/react": "16.9.32",
14+
"@types/react-dom": "16.9.6",
1115
"autoprefixer": "^9.7.5",
1216
"babel-plugin-macros": "^2.8.0",
1317
"mobx": "5.15.0",
@@ -17,15 +21,16 @@
1721
"react-dom": "^16.13.0",
1822
"react-router-dom": "^5.1.2",
1923
"react-scripts": "3.4.0",
20-
"tailwind.macro": "^1.0.0-alpha.10"
24+
"tailwind.macro": "^1.0.0-alpha.10",
25+
"typescript": "3.8.3"
2126
},
2227
"scripts": {
2328
"build:css": "postcss src/index.css -o src/styles/tailwind.css",
2429
"watch:css": "postcss src/index.css -o src/styles/tailwind.css",
25-
"start": "npm run watch:css & react-app-rewired start",
26-
"build": "npm run build:css react-app-rewired build",
27-
"test": "react-app-rewired test",
28-
"eject": "react-app-rewired eject",
30+
"start": "npm run watch:css & react-scripts start",
31+
"build": "npm run build:css react-scripts build",
32+
"test": "react-scripts test",
33+
"eject": "react-scripts eject",
2934
"deploy": "export PUBLIC_URL=/2019/$C9_USER/react && npm run build && ./deploy.sh"
3035
},
3136
"eslintConfig": {
@@ -49,8 +54,6 @@
4954
"@babel/plugin-syntax-jsx": "7.2.0",
5055
"@babel/preset-env": "7.7.1",
5156
"babel-eslint": "10.0.3",
52-
"customize-cra": "0.9.1",
53-
"react-app-rewired": "2.1.5",
5457
"tailwindcss": "^1.2.0"
5558
}
5659
}

src/App.test.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/App.js renamed to src/App.tsx

File renamed without changes.

src/components/CounterPage/index.js renamed to src/components/CounterPage/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ import { observer, inject } from 'mobx-react'
44
import stores from '../../stores'
55
const counterStore = stores.counterStore
66

7+
type Props = {
8+
initialCount: number
9+
}
10+
711
@observer
8-
class CounterPage extends Component {
12+
class CounterPage extends Component<Props> {
13+
functionCalling
14+
915
handleIncrement = () => {
1016
counterStore.incrementCounter()
1117
}
File renamed without changes.

0 commit comments

Comments
 (0)