Skip to content

Commit 4701715

Browse files
authored
Merge pull request #134 from iilj/fix/vulnerability_alert_node-notifier_8.0.1
Upgrade react-scripts
2 parents 6c6af25 + 853c133 commit 4701715

File tree

8 files changed

+3300
-2809
lines changed

8 files changed

+3300
-2809
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
],
3131
"rules": {
3232
"prettier/prettier": [
33-
"error",
33+
"warn",
3434
{
3535
"singleQuote": true
3636
}

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
"react-dom": "^16.12.0",
3232
"react-router": "^6.0.0-alpha.5",
3333
"react-router-dom": "^6.0.0-alpha.5",
34-
"react-scripts": "3.4.0",
34+
"react-scripts": "4.0.1",
3535
"reactstrap": "^8.4.1",
36-
"recharts": "^2.0.0-beta.1",
37-
"typescript": "^3.9.5"
36+
"recharts": "2.0.0-beta.8",
37+
"typescript": "^4.1.3"
3838
},
3939
"scripts": {
4040
"start": "react-scripts start",
@@ -63,17 +63,17 @@
6363
]
6464
},
6565
"devDependencies": {
66-
"@typescript-eslint/eslint-plugin": "^3.2.0",
67-
"@typescript-eslint/parser": "^3.2.0",
68-
"eslint": "^6.8.0",
69-
"eslint-config-airbnb": "^18.0.1",
70-
"eslint-config-prettier": "^6.11.0",
71-
"eslint-plugin-import": "^2.20.1",
72-
"eslint-plugin-jsx-a11y": "^6.2.3",
73-
"eslint-plugin-prettier": "^3.1.3",
74-
"eslint-plugin-react": "^7.19.0",
75-
"prettier": "^2.0.5",
76-
"prettier-eslint": "^9.0.1",
66+
"@typescript-eslint/eslint-plugin": "^4.11.1",
67+
"@typescript-eslint/parser": "^4.11.1",
68+
"eslint": "^7.16.0",
69+
"eslint-config-airbnb": "^18.2.1",
70+
"eslint-config-prettier": "^7.1.0",
71+
"eslint-plugin-import": "^2.22.1",
72+
"eslint-plugin-jsx-a11y": "^6.4.1",
73+
"eslint-plugin-prettier": "^3.3.0",
74+
"eslint-plugin-react": "^7.21.5",
75+
"prettier": "^2.2.1",
76+
"prettier-eslint": "^12.0.0",
7777
"prettier-eslint-cli": "^5.0.0"
7878
}
79-
}
79+
}

src/components/ContestLink.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { formatContestUrl } from '../utils/Url';
33
import { ContestId } from '../interfaces/Contest';
4+
import { NewTabLink } from './NewTabLink';
45

56
interface Props {
67
contestId: ContestId;
@@ -11,14 +12,12 @@ interface Props {
1112
export const ContestLink: React.FC<Props> = (props) => {
1213
const { contestId, contestName, rawContestName } = props;
1314
return contestId >= 0 ? (
14-
<a
15+
<NewTabLink
1516
href={formatContestUrl(contestId)}
16-
target="_blank" // eslint-disable-line react/jsx-no-target-blank
17-
rel="noopener"
1817
title={rawContestName ?? contestName}
1918
>
2019
{contestName}
21-
</a>
20+
</NewTabLink>
2221
) : (
2322
<span>{contestName}</span>
2423
);

src/components/NewTabLink.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* eslint react/jsx-no-target-blank: 0 */
2+
import React from 'react';
3+
4+
type Props = React.AnchorHTMLAttributes<HTMLAnchorElement>;
5+
6+
export const NewTabLink: React.FC<Props> = (props) => (
7+
<a
8+
href={props.href}
9+
target="_blank"
10+
rel="noopener"
11+
className={props.className}
12+
title={props.title}
13+
id={props.id}
14+
>
15+
{props.children}
16+
</a>
17+
);

src/components/ProblemLink.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { getRatingColorClass } from '../utils/RatingColor';
66
import { ProblemNo, ProblemLevel } from '../interfaces/Problem';
77
import { Difficulty } from '../interfaces/Difficulty';
88
import { DifficultyCircle } from './DifficultyCircle';
9+
import { NewTabLink } from './NewTabLink';
910

1011
export const ProblemLinkColorModes = ['None', 'Level', 'Difficulty'] as const;
1112
export type ProblemLinkColorMode = typeof ProblemLinkColorModes[number];
@@ -57,15 +58,13 @@ export const ProblemLink: React.FC<Props> = (props) => {
5758
</UncontrolledTooltip>
5859
</>
5960
)}
60-
<a
61+
<NewTabLink
6162
href={formatProblemUrl(problemNo)}
62-
target="_blank" // eslint-disable-line react/jsx-no-target-blank
63-
rel="noopener"
6463
className={className}
6564
title={problemTitle}
6665
>
6766
{problemTitle}
68-
</a>
67+
</NewTabLink>
6968
</>
7069
);
7170
};

src/components/SubmissionLink.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { formatSubmissionUrl } from '../utils/Url';
33
import { SubmissionId } from '../interfaces/Problem';
4+
import { NewTabLink } from './NewTabLink';
45

56
interface Props {
67
submissionId: SubmissionId;
@@ -11,14 +12,12 @@ interface Props {
1112
export const SubmissionLink: React.FC<Props> = (props) => {
1213
const { submissionId, submissionTitle, id } = props;
1314
return (
14-
<a
15+
<NewTabLink
1516
href={formatSubmissionUrl(submissionId)}
16-
target="_blank" // eslint-disable-line react/jsx-no-target-blank
17-
rel="noopener"
1817
title={submissionTitle}
1918
id={id}
2019
>
2120
{submissionTitle}
22-
</a>
21+
</NewTabLink>
2322
);
2423
};

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"resolveJsonModule": true,
1818
"isolatedModules": true,
1919
"noEmit": true,
20-
"jsx": "react"
20+
"jsx": "react-jsx",
21+
"noFallthroughCasesInSwitch": true
2122
},
2223
"include": [
2324
"src"

0 commit comments

Comments
 (0)