Skip to content

Commit 5a8989f

Browse files
committed
refactor(src): ♻️ remove extra boilerplates
Fix facebook/create-react-app#10144
1 parent 6e42f9c commit 5a8989f

File tree

9 files changed

+12
-226
lines changed

9 files changed

+12
-226
lines changed

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"plugins": ["prettier"],
33
"extends": [
44
"react-app",
5+
"react-app/jest",
56
"plugin:prettier/recommended",
67
"prettier/react",
78
"prettier/flowtype",

.lintstagedrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"prettier --write",
44
"git add"
55
],
6-
"package.json": ["yarn lint:package"],
6+
"package.json": ["yarn format:package"],
77
"**/*.{js,jsx,tx,tsx}": ["yarn lint"]
88
}

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

package.json

+1-11
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"commit": "gacp",
2525
"eject": "react-scripts eject",
2626
"format": "prettier --write \"./**/*.{js,ts,css,less,json,md,html,yml,yaml,pcss,jsx,tsx}\"",
27+
"format:package": "sort-package-json",
2728
"lint": "eslint src --ext .tsx,.ts,.jsx,.js",
28-
"lint:package": "sort-package-json",
2929
"start": "react-scripts start",
3030
"test": "react-scripts test"
3131
},
@@ -63,18 +63,8 @@
6363
"@types/node": "^14.14.10",
6464
"@types/react": "^17.0.0",
6565
"@types/react-dom": "^17.0.0",
66-
"@typescript-eslint/eslint-plugin": "^4.9.0",
67-
"@typescript-eslint/parser": "^4.9.0",
68-
"babel-eslint": "^10.1.0",
69-
"eslint": "^7.15.0",
7066
"eslint-config-prettier": "^7.0.0",
71-
"eslint-config-react-app": "^6.0.0",
72-
"eslint-plugin-flowtype": "^5.2.0",
73-
"eslint-plugin-import": "^2.22.1",
74-
"eslint-plugin-jsx-a11y": "^6.4.1",
7567
"eslint-plugin-prettier": "^3.2.0",
76-
"eslint-plugin-react": "^7.21.5",
77-
"eslint-plugin-react-hooks": "^4.2.0",
7868
"gacp": "^2.10.2",
7969
"husky": "^4.3.0",
8070
"lint-staged": "^10.5.3",

src/App.css

-35
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,3 @@
11
.App {
22
text-align: center;
33
}
4-
5-
.App-logo {
6-
height: 40vmin;
7-
pointer-events: none;
8-
}
9-
10-
@media (prefers-reduced-motion: no-preference) {
11-
.App-logo {
12-
animation: App-logo-spin infinite 20s linear;
13-
}
14-
}
15-
16-
.App-header {
17-
background-color: #282c34;
18-
min-height: 100vh;
19-
display: flex;
20-
flex-direction: column;
21-
align-items: center;
22-
justify-content: center;
23-
font-size: calc(10px + 2vmin);
24-
color: white;
25-
}
26-
27-
.App-link {
28-
color: #61dafb;
29-
}
30-
31-
@keyframes App-logo-spin {
32-
from {
33-
transform: rotate(0deg);
34-
}
35-
to {
36-
transform: rotate(360deg);
37-
}
38-
}

src/App.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from "react";
22
import { render, screen } from "@testing-library/react";
33
import App from "./App";
44

5-
test("renders learn react link", () => {
5+
test("renders hello world", () => {
66
render(<App />);
7-
const linkElement = screen.getByText(/learn react/i);
8-
expect(linkElement).toBeInTheDocument();
7+
const h1Element = screen.getByText(/Hello World/i);
8+
expect(h1Element).toBeInTheDocument();
99
});

src/App.tsx

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
11
import React from "react";
2-
import logo from "./logo.svg";
32
import "./App.css";
43

54
function App() {
65
return (
76
<div className="App">
8-
<header className="App-header">
9-
<img src={logo} className="App-logo" alt="logo" />
10-
<p>
11-
Edit <code>src/App.tsx</code> and save to reload.
12-
</p>
13-
<a
14-
className="App-link"
15-
href="https://reactjs.org"
16-
target="_blank"
17-
rel="noopener noreferrer"
18-
>
19-
Learn React
20-
</a>
21-
</header>
7+
<h1>Hello World</h1>
228
</div>
239
);
2410
}

src/logo.svg

-1
This file was deleted.

yarn.lock

+2-160
Original file line numberDiff line numberDiff line change
@@ -1300,22 +1300,6 @@
13001300
minimatch "^3.0.4"
13011301
strip-json-comments "^3.1.1"
13021302

1303-
"@eslint/eslintrc@^0.2.2":
1304-
version "0.2.2"
1305-
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.2.2.tgz#d01fc791e2fc33e88a29d6f3dc7e93d0cd784b76"
1306-
integrity sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==
1307-
dependencies:
1308-
ajv "^6.12.4"
1309-
debug "^4.1.1"
1310-
espree "^7.3.0"
1311-
globals "^12.1.0"
1312-
ignore "^4.0.6"
1313-
import-fresh "^3.2.1"
1314-
js-yaml "^3.13.1"
1315-
lodash "^4.17.19"
1316-
minimatch "^3.0.4"
1317-
strip-json-comments "^3.1.1"
1318-
13191303
13201304
version "2.1.4"
13211305
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5"
@@ -2050,19 +2034,6 @@
20502034
semver "^7.3.2"
20512035
tsutils "^3.17.1"
20522036

2053-
"@typescript-eslint/eslint-plugin@^4.9.0":
2054-
version "4.9.0"
2055-
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.9.0.tgz#8fde15743413661fdc086c9f1f5d74a80b856113"
2056-
integrity sha512-WrVzGMzzCrgrpnQMQm4Tnf+dk+wdl/YbgIgd5hKGa2P+lnJ2MON+nQnbwgbxtN9QDLi8HO+JAq0/krMnjQK6Cw==
2057-
dependencies:
2058-
"@typescript-eslint/experimental-utils" "4.9.0"
2059-
"@typescript-eslint/scope-manager" "4.9.0"
2060-
debug "^4.1.1"
2061-
functional-red-black-tree "^1.0.1"
2062-
regexpp "^3.0.0"
2063-
semver "^7.3.2"
2064-
tsutils "^3.17.1"
2065-
20662037
"@typescript-eslint/[email protected]", "@typescript-eslint/experimental-utils@^4.0.1":
20672038
version "4.8.1"
20682039
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.8.1.tgz#27275c20fa4336df99ebcf6195f7d7aa7aa9f22d"
@@ -2075,18 +2046,6 @@
20752046
eslint-scope "^5.0.0"
20762047
eslint-utils "^2.0.0"
20772048

2078-
"@typescript-eslint/[email protected]":
2079-
version "4.9.0"
2080-
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.9.0.tgz#23a296b85d243afba24e75a43fd55aceda5141f0"
2081-
integrity sha512-0p8GnDWB3R2oGhmRXlEnCvYOtaBCijtA5uBfH5GxQKsukdSQyI4opC4NGTUb88CagsoNQ4rb/hId2JuMbzWKFQ==
2082-
dependencies:
2083-
"@types/json-schema" "^7.0.3"
2084-
"@typescript-eslint/scope-manager" "4.9.0"
2085-
"@typescript-eslint/types" "4.9.0"
2086-
"@typescript-eslint/typescript-estree" "4.9.0"
2087-
eslint-scope "^5.0.0"
2088-
eslint-utils "^2.0.0"
2089-
20902049
"@typescript-eslint/experimental-utils@^3.10.1":
20912050
version "3.10.1"
20922051
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz#e179ffc81a80ebcae2ea04e0332f8b251345a686"
@@ -2108,16 +2067,6 @@
21082067
"@typescript-eslint/typescript-estree" "4.8.1"
21092068
debug "^4.1.1"
21102069

2111-
"@typescript-eslint/parser@^4.9.0":
2112-
version "4.9.0"
2113-
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.9.0.tgz#bb65f1214b5e221604996db53ef77c9d62b09249"
2114-
integrity sha512-QRSDAV8tGZoQye/ogp28ypb8qpsZPV6FOLD+tbN4ohKUWHD2n/u0Q2tIBnCsGwQCiD94RdtLkcqpdK4vKcLCCw==
2115-
dependencies:
2116-
"@typescript-eslint/scope-manager" "4.9.0"
2117-
"@typescript-eslint/types" "4.9.0"
2118-
"@typescript-eslint/typescript-estree" "4.9.0"
2119-
debug "^4.1.1"
2120-
21212070
"@typescript-eslint/[email protected]":
21222071
version "4.8.1"
21232072
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.8.1.tgz#e343c475f8f1d15801b546cb17d7f309b768fdce"
@@ -2126,14 +2075,6 @@
21262075
"@typescript-eslint/types" "4.8.1"
21272076
"@typescript-eslint/visitor-keys" "4.8.1"
21282077

2129-
"@typescript-eslint/[email protected]":
2130-
version "4.9.0"
2131-
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.9.0.tgz#5eefe305d6b71d1c85af6587b048426bfd4d3708"
2132-
integrity sha512-q/81jtmcDtMRE+nfFt5pWqO0R41k46gpVLnuefqVOXl4QV1GdQoBWfk5REcipoJNQH9+F5l+dwa9Li5fbALjzg==
2133-
dependencies:
2134-
"@typescript-eslint/types" "4.9.0"
2135-
"@typescript-eslint/visitor-keys" "4.9.0"
2136-
21372078
"@typescript-eslint/[email protected]":
21382079
version "3.10.1"
21392080
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.1.tgz#1d7463fa7c32d8a23ab508a803ca2fe26e758727"
@@ -2144,11 +2085,6 @@
21442085
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.8.1.tgz#23829c73c5fc6f4fcd5346a7780b274f72fee222"
21452086
integrity sha512-ave2a18x2Y25q5K05K/U3JQIe2Av4+TNi/2YuzyaXLAsDx6UZkz1boZ7nR/N6Wwae2PpudTZmHFXqu7faXfHmA==
21462087

2147-
"@typescript-eslint/[email protected]":
2148-
version "4.9.0"
2149-
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.9.0.tgz#3fe8c3632abd07095c7458f7451bd14c85d0033c"
2150-
integrity sha512-luzLKmowfiM/IoJL/rus1K9iZpSJK6GlOS/1ezKplb7MkORt2dDcfi8g9B0bsF6JoRGhqn0D3Va55b+vredFHA==
2151-
21522088
"@typescript-eslint/[email protected]":
21532089
version "3.10.1"
21542090
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz#fd0061cc38add4fad45136d654408569f365b853"
@@ -2177,20 +2113,6 @@
21772113
semver "^7.3.2"
21782114
tsutils "^3.17.1"
21792115

2180-
"@typescript-eslint/[email protected]":
2181-
version "4.9.0"
2182-
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.9.0.tgz#38a98df6ee281cfd6164d6f9d91795b37d9e508c"
2183-
integrity sha512-rmDR++PGrIyQzAtt3pPcmKWLr7MA+u/Cmq9b/rON3//t5WofNR4m/Ybft2vOLj0WtUzjn018ekHjTsnIyBsQug==
2184-
dependencies:
2185-
"@typescript-eslint/types" "4.9.0"
2186-
"@typescript-eslint/visitor-keys" "4.9.0"
2187-
debug "^4.1.1"
2188-
globby "^11.0.1"
2189-
is-glob "^4.0.1"
2190-
lodash "^4.17.15"
2191-
semver "^7.3.2"
2192-
tsutils "^3.17.1"
2193-
21942116
"@typescript-eslint/[email protected]":
21952117
version "3.10.1"
21962118
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz#cd4274773e3eb63b2e870ac602274487ecd1e931"
@@ -2206,14 +2128,6 @@
22062128
"@typescript-eslint/types" "4.8.1"
22072129
eslint-visitor-keys "^2.0.0"
22082130

2209-
"@typescript-eslint/[email protected]":
2210-
version "4.9.0"
2211-
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.9.0.tgz#f284e9fac43f2d6d35094ce137473ee321f266c8"
2212-
integrity sha512-sV45zfdRqQo1A97pOSx3fsjR+3blmwtdCt8LDrXgCX36v4Vmz4KHrhpV6Fo2cRdXmyumxx11AHw0pNJqCNpDyg==
2213-
dependencies:
2214-
"@typescript-eslint/types" "4.9.0"
2215-
eslint-visitor-keys "^2.0.0"
2216-
22172131
"@vivaxy/git@^4.1.1":
22182132
version "4.1.3"
22192133
resolved "https://registry.yarnpkg.com/@vivaxy/git/-/git-4.1.3.tgz#58c525887a638f4900b4cb71182589c640c7b7dd"
@@ -2407,7 +2321,7 @@ acorn-globals@^6.0.0:
24072321
acorn "^7.1.1"
24082322
acorn-walk "^7.1.1"
24092323

2410-
acorn-jsx@^5.2.0, acorn-jsx@^5.3.1:
2324+
acorn-jsx@^5.2.0:
24112325
version "5.3.1"
24122326
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b"
24132327
integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==
@@ -4966,7 +4880,7 @@ eslint-plugin-jest@^24.1.0:
49664880
dependencies:
49674881
"@typescript-eslint/experimental-utils" "^4.0.1"
49684882

4969-
eslint-plugin-jsx-a11y@^6.3.1, eslint-plugin-jsx-a11y@^6.4.1:
4883+
eslint-plugin-jsx-a11y@^6.3.1:
49704884
version "6.4.1"
49714885
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz#a2d84caa49756942f42f1ffab9002436391718fd"
49724886
integrity sha512-0rGPJBbwHoGNPU73/QCLP/vveMlM1b1Z9PponxO87jfr6tuH5ligXbDT6nHSSzBC8ovX2Z+BQu7Bk5D/Xgq9zg==
@@ -5106,49 +5020,6 @@ eslint@^7.11.0:
51065020
text-table "^0.2.0"
51075021
v8-compile-cache "^2.0.3"
51085022

5109-
eslint@^7.15.0:
5110-
version "7.15.0"
5111-
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.15.0.tgz#eb155fb8ed0865fcf5d903f76be2e5b6cd7e0bc7"
5112-
integrity sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA==
5113-
dependencies:
5114-
"@babel/code-frame" "^7.0.0"
5115-
"@eslint/eslintrc" "^0.2.2"
5116-
ajv "^6.10.0"
5117-
chalk "^4.0.0"
5118-
cross-spawn "^7.0.2"
5119-
debug "^4.0.1"
5120-
doctrine "^3.0.0"
5121-
enquirer "^2.3.5"
5122-
eslint-scope "^5.1.1"
5123-
eslint-utils "^2.1.0"
5124-
eslint-visitor-keys "^2.0.0"
5125-
espree "^7.3.1"
5126-
esquery "^1.2.0"
5127-
esutils "^2.0.2"
5128-
file-entry-cache "^6.0.0"
5129-
functional-red-black-tree "^1.0.1"
5130-
glob-parent "^5.0.0"
5131-
globals "^12.1.0"
5132-
ignore "^4.0.6"
5133-
import-fresh "^3.0.0"
5134-
imurmurhash "^0.1.4"
5135-
is-glob "^4.0.0"
5136-
js-yaml "^3.13.1"
5137-
json-stable-stringify-without-jsonify "^1.0.1"
5138-
levn "^0.4.1"
5139-
lodash "^4.17.19"
5140-
minimatch "^3.0.4"
5141-
natural-compare "^1.4.0"
5142-
optionator "^0.9.1"
5143-
progress "^2.0.0"
5144-
regexpp "^3.1.0"
5145-
semver "^7.2.1"
5146-
strip-ansi "^6.0.0"
5147-
strip-json-comments "^3.1.0"
5148-
table "^5.2.3"
5149-
text-table "^0.2.0"
5150-
v8-compile-cache "^2.0.3"
5151-
51525023
espree@^7.3.0:
51535024
version "7.3.0"
51545025
resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.0.tgz#dc30437cf67947cf576121ebd780f15eeac72348"
@@ -5158,15 +5029,6 @@ espree@^7.3.0:
51585029
acorn-jsx "^5.2.0"
51595030
eslint-visitor-keys "^1.3.0"
51605031

5161-
espree@^7.3.1:
5162-
version "7.3.1"
5163-
resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6"
5164-
integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==
5165-
dependencies:
5166-
acorn "^7.4.0"
5167-
acorn-jsx "^5.3.1"
5168-
eslint-visitor-keys "^1.3.0"
5169-
51705032
esprima@^4.0.0, esprima@^4.0.1:
51715033
version "4.0.1"
51725034
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
@@ -5479,13 +5341,6 @@ file-entry-cache@^5.0.1:
54795341
dependencies:
54805342
flat-cache "^2.0.1"
54815343

5482-
file-entry-cache@^6.0.0:
5483-
version "6.0.0"
5484-
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.0.tgz#7921a89c391c6d93efec2169ac6bf300c527ea0a"
5485-
integrity sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==
5486-
dependencies:
5487-
flat-cache "^3.0.4"
5488-
54895344
54905345
version "6.1.1"
54915346
resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.1.1.tgz#a6f29dfb3f5933a1c350b2dbaa20ac5be0539baa"
@@ -5598,24 +5453,11 @@ flat-cache@^2.0.1:
55985453
rimraf "2.6.3"
55995454
write "1.0.3"
56005455

5601-
flat-cache@^3.0.4:
5602-
version "3.0.4"
5603-
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
5604-
integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==
5605-
dependencies:
5606-
flatted "^3.1.0"
5607-
rimraf "^3.0.2"
5608-
56095456
flatted@^2.0.0:
56105457
version "2.0.2"
56115458
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
56125459
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
56135460

5614-
flatted@^3.1.0:
5615-
version "3.1.0"
5616-
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.0.tgz#a5d06b4a8b01e3a63771daa5cb7a1903e2e57067"
5617-
integrity sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==
5618-
56195461
flatten@^1.0.2:
56205462
version "1.0.3"
56215463
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b"

0 commit comments

Comments
 (0)