Skip to content

Commit e582fbb

Browse files
author
Mike Nikles
committed
Switch to the TypeScript template.
1 parent a7f7039 commit e582fbb

File tree

10 files changed

+80
-27
lines changed

10 files changed

+80
-27
lines changed

README.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,3 @@ You don’t have to ever use `eject`. The curated feature set is suitable for sm
4444
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
4545

4646
To learn React, check out the [React documentation](https://reactjs.org/).
47-
48-
### Code Splitting
49-
50-
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51-
52-
### Analyzing the Bundle Size
53-
54-
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55-
56-
### Making a Progressive Web App
57-
58-
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59-
60-
### Advanced Configuration
61-
62-
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63-
64-
### Deployment
65-
66-
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67-
68-
### `yarn build` fails to minify
69-
70-
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
"@testing-library/jest-dom": "^5.11.4",
77
"@testing-library/react": "^11.1.0",
88
"@testing-library/user-event": "^12.1.10",
9+
"@types/jest": "^26.0.15",
10+
"@types/node": "^12.0.0",
11+
"@types/react": "^17.0.0",
12+
"@types/react-dom": "^17.0.0",
913
"react": "^17.0.2",
1014
"react-dom": "^17.0.2",
1115
"react-scripts": "4.0.3",
16+
"typescript": "^4.1.2",
1217
"web-vitals": "^1.0.1"
1318
},
1419
"scripts": {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import { render, screen } from '@testing-library/react';
23
import App from './App';
34

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import logo from './logo.svg';
23
import './App.css';
34

@@ -7,7 +8,7 @@ function App() {
78
<header className="App-header">
89
<img src={logo} className="App-logo" alt="logo" />
910
<p>
10-
Edit <code>src/App.js</code> and save to reload.
11+
Edit <code>src/App.tsx</code> and save to reload.
1112
</p>
1213
<a
1314
className="App-link"
File renamed without changes.

src/react-app-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="react-scripts" />

src/reportWebVitals.js renamed to src/reportWebVitals.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
const reportWebVitals = onPerfEntry => {
1+
import { ReportHandler } from 'web-vitals';
2+
3+
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
24
if (onPerfEntry && onPerfEntry instanceof Function) {
35
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
46
getCLS(onPerfEntry);
File renamed without changes.

tsconfig.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
9+
"allowJs": true,
10+
"skipLibCheck": true,
11+
"esModuleInterop": true,
12+
"allowSyntheticDefaultImports": true,
13+
"strict": true,
14+
"forceConsistentCasingInFileNames": true,
15+
"noFallthroughCasesInSwitch": true,
16+
"module": "esnext",
17+
"moduleResolution": "node",
18+
"resolveJsonModule": true,
19+
"isolatedModules": true,
20+
"noEmit": true,
21+
"jsx": "react-jsx"
22+
},
23+
"include": [
24+
"src"
25+
]
26+
}

yarn.lock

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@
17331733
dependencies:
17341734
"@types/istanbul-lib-report" "*"
17351735

1736-
"@types/jest@*":
1736+
"@types/jest@*", "@types/jest@^26.0.15":
17371737
version "26.0.23"
17381738
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.23.tgz#a1b7eab3c503b80451d019efb588ec63522ee4e7"
17391739
integrity sha512-ZHLmWMJ9jJ9PTiT58juykZpL7KjwJywFN3Rr2pTSkyQfydf/rk22yS7W8p5DaVUMQ2BQC7oYiU3FjbTM/mYrOA==
@@ -1761,6 +1761,11 @@
17611761
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055"
17621762
integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==
17631763

1764+
"@types/node@^12.0.0":
1765+
version "12.20.15"
1766+
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.15.tgz#10ee6a6a3f971966fddfa3f6e89ef7a73ec622df"
1767+
integrity sha512-F6S4Chv4JicJmyrwlDkxUdGNSplsQdGwp1A0AJloEVDirWdZOAiRHhovDlsFkKUrquUXhz1imJhXHsf59auyAg==
1768+
17641769
"@types/normalize-package-data@^2.4.0":
17651770
version "2.4.0"
17661771
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
@@ -1776,18 +1781,44 @@
17761781
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.1.tgz#374e31645d58cb18a07b3ecd8e9dede4deb2cccd"
17771782
integrity sha512-DxZZbyMAM9GWEzXL+BMZROWz9oo6A9EilwwOMET2UVu2uZTqMWS5S69KVtuVKaRjCUpcrOXRalet86/OpG4kqw==
17781783

1784+
"@types/prop-types@*":
1785+
version "15.7.3"
1786+
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
1787+
integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==
1788+
17791789
"@types/q@^1.5.1":
17801790
version "1.5.4"
17811791
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24"
17821792
integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==
17831793

1794+
"@types/react-dom@^17.0.0":
1795+
version "17.0.7"
1796+
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.7.tgz#b8ee15ead9e5d6c2c858b44949fdf2ebe5212232"
1797+
integrity sha512-Wd5xvZRlccOrCTej8jZkoFZuZRKHzanDDv1xglI33oBNFMWrqOSzrvWFw7ngSiZjrpJAzPKFtX7JvuXpkNmQHA==
1798+
dependencies:
1799+
"@types/react" "*"
1800+
1801+
"@types/react@*", "@types/react@^17.0.0":
1802+
version "17.0.11"
1803+
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.11.tgz#67fcd0ddbf5a0b083a0f94e926c7d63f3b836451"
1804+
integrity sha512-yFRQbD+whVonItSk7ZzP/L+gPTJVBkL/7shLEF+i9GC/1cV3JmUxEQz6+9ylhUpWSDuqo1N9qEvqS6vTj4USUA==
1805+
dependencies:
1806+
"@types/prop-types" "*"
1807+
"@types/scheduler" "*"
1808+
csstype "^3.0.2"
1809+
17841810
17851811
version "0.0.8"
17861812
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194"
17871813
integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==
17881814
dependencies:
17891815
"@types/node" "*"
17901816

1817+
"@types/scheduler@*":
1818+
version "0.16.1"
1819+
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275"
1820+
integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==
1821+
17911822
"@types/source-list-map@*":
17921823
version "0.1.2"
17931824
resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9"
@@ -3819,6 +3850,11 @@ cssstyle@^2.2.0:
38193850
dependencies:
38203851
cssom "~0.3.6"
38213852

3853+
csstype@^3.0.2:
3854+
version "3.0.8"
3855+
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340"
3856+
integrity sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw==
3857+
38223858
cyclist@^1.0.1:
38233859
version "1.0.1"
38243860
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
@@ -10632,6 +10668,11 @@ typedarray@^0.0.6:
1063210668
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
1063310669
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
1063410670

10671+
typescript@^4.1.2:
10672+
version "4.3.2"
10673+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805"
10674+
integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==
10675+
1063510676
unicode-canonical-property-names-ecmascript@^1.0.4:
1063610677
version "1.0.4"
1063710678
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818"

0 commit comments

Comments
 (0)