Skip to content

Commit 4e4a45a

Browse files
committed
Upgrade react-scripts and typescript. ESLint and TS fixes.
* Remove unused imports * About: remove unnecessary "Photo of" * App: replace kabob-case attributes * DemoInfo: add missing keys * Landing: don't nest within <p> * PartnerTable: at missing keys, use === instead of ==, replace kabob-case attributes * Record/Case: add `rel="noopener noreferrer" * Rules/ChargeTypeRule: use === instead of == * reducer: use forEach instead of map, replace reduce comma shorthand function returns * Add missing types for promise resolve parameter and action functions * selectors test: add missing mockData attributes
1 parent 5c1f4d0 commit 4e4a45a

File tree

24 files changed

+31768
-22508
lines changed

24 files changed

+31768
-22508
lines changed

src/frontend/package-lock.json

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

src/frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
"react-redux": "^7.2.2",
3131
"react-router-dom": "^5.1.2",
3232
"react-router-hash-link": "^2.0.0",
33-
"react-scripts": "3.3.0",
33+
"react-scripts": "^5.0.1",
3434
"react-test-renderer": "^16.11.0",
3535
"redux": "^4.0.5",
3636
"redux-mock-store": "^1.5.4",
3737
"reselect": "^4.0.0",
3838
"sass": "^1.57.1",
3939
"tachyons": "^4.11.1",
40-
"typescript": "3.7.2"
40+
"typescript": "^4.9.4"
4141
},
4242
"scripts": {
4343
"start": "react-scripts start",

src/frontend/src/components/About/__snapshots__/About.test.tsx.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ exports[`renders correctly 1`] = `
7171
className="mw5 mb5 mr3"
7272
>
7373
<img
74-
alt="Photo of Michael Zhang"
74+
alt="Michael Zhang"
7575
className="img w5 mb3"
7676
src="/img/mz-2x.jpg"
7777
/>
@@ -97,7 +97,7 @@ exports[`renders correctly 1`] = `
9797
className="mw5 mb5 mr3"
9898
>
9999
<img
100-
alt="Photo of Jordan Witte"
100+
alt="Jordan Witte"
101101
className="img w5 mb3"
102102
src="/img/jw-2x.jpg"
103103
/>
@@ -123,7 +123,7 @@ exports[`renders correctly 1`] = `
123123
className="mw5 mb5 mr3"
124124
>
125125
<img
126-
alt="Photo of Nick Schimek"
126+
alt="Nick Schimek"
127127
className="img w5 mb3"
128128
src="/img/ns-2x.jpg"
129129
/>
@@ -149,7 +149,7 @@ exports[`renders correctly 1`] = `
149149
className="mw5 mb5 mr3"
150150
>
151151
<img
152-
alt="Photo of Hunter Marcks"
152+
alt="Hunter Marcks"
153153
className="img w5 mb3"
154154
src="/img/hm-2x.jpg"
155155
/>
@@ -175,7 +175,7 @@ exports[`renders correctly 1`] = `
175175
className="mw5 mb5 mr3"
176176
>
177177
<img
178-
alt="Photo of Kent Shikama"
178+
alt="Kent Shikama"
179179
className="img w5 mb3"
180180
src="/img/ks-2x.jpg"
181181
/>

src/frontend/src/components/About/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default class About extends React.Component {
6464
<img
6565
className="img w5 mb3"
6666
src="/img/mz-2x.jpg"
67-
alt="Photo of Michael Zhang"
67+
alt="Michael Zhang"
6868
/>
6969
<dl>
7070
<dt className="fw8 mb2">Michael Zhang</dt>
@@ -86,7 +86,7 @@ export default class About extends React.Component {
8686
<img
8787
className="img w5 mb3"
8888
src="/img/jw-2x.jpg"
89-
alt="Photo of Jordan Witte"
89+
alt="Jordan Witte"
9090
/>
9191
<dl>
9292
<dt className="fw8 mb2">Jordan Witte</dt>
@@ -106,7 +106,7 @@ export default class About extends React.Component {
106106
<img
107107
className="img w5 mb3"
108108
src="/img/ns-2x.jpg"
109-
alt="Photo of Nick Schimek"
109+
alt="Nick Schimek"
110110
/>
111111
<dl>
112112
<dt className="fw8 mb2">Nick Schimek</dt>
@@ -129,7 +129,7 @@ export default class About extends React.Component {
129129
<img
130130
className="img w5 mb3"
131131
src="/img/hm-2x.jpg"
132-
alt="Photo of Hunter Marcks"
132+
alt="Hunter Marcks"
133133
/>
134134
<dl>
135135
<dt className="fw8 mb2">Hunter Marcks</dt>
@@ -148,7 +148,7 @@ export default class About extends React.Component {
148148
<img
149149
className="img w5 mb3"
150150
src="/img/ks-2x.jpg"
151-
alt="Photo of Kent Shikama"
151+
alt="Kent Shikama"
152152
/>
153153
<dl>
154154
<dt className="fw8 mb2">Kent Shikama</dt>

src/frontend/src/components/AccessibilityStatement/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from "react";
2-
import { HashLink as Link } from "react-router-hash-link";
32

43
class AccessibilityStatement extends React.Component {
54

src/frontend/src/components/App/__snapshots__/App.test.tsx.snap

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ Array [
161161
xmlns="http://www.w3.org/2000/svg"
162162
>
163163
<path
164-
clip-rule="evenodd"
164+
clipRule="evenodd"
165165
d="M6.56 78.42L1.88 68.04l4.68-15.85L8.58 27.7 12.48.82h7.3l6.14 3 1.59 8.74 8.81 1.77 7.86-1.77 7.85 1.77 3.78-3.54h8.03l4.98-2.23 7.44-1.8h25.76l6.56 5.8-3.77 12.87-5.72 11.1 4.19 3.09-1.26 6.43v32.37H6.56z"
166166
fill="#D0E1F7"
167-
fill-rule="evenodd"
167+
fillRule="evenodd"
168168
/>
169169
<circle
170170
cx="26.76"
@@ -1563,31 +1563,31 @@ Array [
15631563
className="lh-copy pt3"
15641564
>
15651565
For other communication (to learn more, help out, etc.) you can also contact:
1566-
<ul
1567-
className="ml4 mt2"
1566+
</p>
1567+
<ul
1568+
className="ml4 mt2"
1569+
>
1570+
<li
1571+
className="mb2"
15681572
>
1569-
<li
1570-
className="mb2"
1573+
Michael Zhang, expungement attorney at Qiu-Qiu Law:
1574+
1575+
<span
1576+
className="nowrap"
15711577
>
1572-
Michael Zhang, expungement attorney at Qiu-Qiu Law:
1573-
1574-
<span
1575-
className="nowrap"
1576-
>
1577-
1578-
</span>
1579-
</li>
1580-
<li>
1581-
Jordan Witte, project manager at Code for PDX:
1582-
1583-
<span
1584-
className="nowrap"
1585-
>
1586-
1587-
</span>
1588-
</li>
1589-
</ul>
1590-
</p>
1578+
1579+
</span>
1580+
</li>
1581+
<li>
1582+
Jordan Witte, project manager at Code for PDX:
1583+
1584+
<span
1585+
className="nowrap"
1586+
>
1587+
1588+
</span>
1589+
</li>
1590+
</ul>
15911591
</div>
15921592
</div>
15931593
<span

src/frontend/src/components/Demo/DemoInfo.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ class DemoInfo extends React.Component {
2626
</div>
2727
)}
2828
</p>
29-
{description.map((line: string) => (
30-
<p className="pb2">{line}</p>
29+
{description.map((line: string, idx: number) => (
30+
<p key={idx} className="pb2">
31+
{line}
32+
</p>
3133
))}
3234
</div>
3335
);
@@ -122,8 +124,8 @@ class DemoInfo extends React.Component {
122124
.
123125
</p>
124126
<div>
125-
{examplesData.map((e: any) => (
126-
<div>
127+
{examplesData.map((e: any, idx: number) => (
128+
<div key={idx}>
127129
<h2 className="fw9 bt b--light-gray pt2 mb3">{e.name}</h2>
128130
<div className="mw7 mb4">
129131
{this.formattedInfo(

src/frontend/src/components/FillForms/UserDataForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class UserDataForm extends React.Component<Props, State> {
7373
this.state.phoneNumber
7474
);
7575
const zipCodeMatch = this.zipCodePattern.exec(this.state.zipCode);
76-
return new Promise((resolve) => {
76+
return new Promise((resolve: (value?: unknown) => void) => {
7777
this.setState<any>(
7878
{
7979
invalidZipCode: this.state.zipCode.length > 0 && !zipCodeMatch,

src/frontend/src/components/Landing/index.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from "react";
2-
import Header from "../Header";
32
import PartnerTable from "../PartnerTable";
43
import { Link } from "react-router-dom";
54
import {
@@ -90,21 +89,19 @@ class Landing extends React.Component {
9089
<p className="lh-copy pt3">
9190
For other communication (to learn more, help out, etc.)
9291
you can also contact:
93-
<ul className="ml4 mt2">
94-
<li className="mb2">
95-
Michael Zhang, expungement attorney at Qiu-Qiu Law:{" "}
96-
<span className="nowrap">
97-
98-
</span>
99-
</li>
100-
<li>
101-
Jordan Witte, project manager at Code for PDX:{" "}
102-
<span className="nowrap">
103-
104-
</span>
105-
</li>
106-
</ul>
10792
</p>
93+
<ul className="ml4 mt2">
94+
<li className="mb2">
95+
Michael Zhang, expungement attorney at Qiu-Qiu Law:{" "}
96+
<span className="nowrap">[email protected]</span>
97+
</li>
98+
<li>
99+
Jordan Witte, project manager at Code for PDX:{" "}
100+
<span className="nowrap">
101+
102+
</span>
103+
</li>
104+
</ul>
108105
</DisclosurePanel>
109106
</div>
110107
</Disclosure>

src/frontend/src/components/Manual/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import React from "react";
22
import { HashLink as Link } from "react-router-hash-link";
3-
import {
4-
Disclosure,
5-
DisclosureButton,
6-
DisclosurePanel,
7-
} from "@reach/disclosure";
83
import EditingGuide from "./EditingGuide";
94

105
class Manual extends React.Component {

0 commit comments

Comments
 (0)