Skip to content

Commit bc17919

Browse files
committed
chore: lint js code
1 parent 3734c27 commit bc17919

File tree

8 files changed

+38
-41
lines changed

8 files changed

+38
-41
lines changed

.eslintrc.js

-27
This file was deleted.

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ client-init:
100100

101101
client-lint:
102102
cd ./client && npm run lint
103+
# npx prettier --write "src/**/*.{js,cjs,jsx,ts,tsx,json,css,scss,md}"
103104

104105
client-update:
105106
npm install -g npm

client/.eslintrc.cjs

+2-7
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ module.exports = {
33
browser: true,
44
es2021: true,
55
},
6-
extends: [
7-
"eslint:recommended",
8-
"plugin:@typescript-eslint/recommended",
9-
"plugin:react/recommended",
10-
],
6+
extends: ["eslint:recommended", "plugin:react/recommended"],
117
overrides: [
128
{
139
env: {
@@ -19,11 +15,10 @@ module.exports = {
1915
},
2016
},
2117
],
22-
parser: "@typescript-eslint/parser",
2318
parserOptions: {
2419
ecmaVersion: "latest",
2520
sourceType: "module",
2621
},
27-
plugins: ["@typescript-eslint", "react"],
22+
plugins: ["react"],
2823
rules: {},
2924
};

client/src/App.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ const Footer = () => {
8484
<a
8585
href="https://github.com/FullStackWithLawrence/aws-openai"
8686
target="_blank"
87+
rel="noreferrer"
8788
>
8889
<img src="/github-logo.svg" /> Source code
8990
</a>
@@ -117,7 +118,7 @@ const App = () => {
117118
},
118119
}}
119120
>
120-
<a href="https://openai.com/" target="_blank">
121+
<a href="https://openai.com/" target="_blank" rel="noreferrer">
121122
<img
122123
src="/OpenAI_Logo.png"
123124
alt="OpenAI Logo"

client/src/components/about/Component.jsx

+18-5
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,49 @@
22
//
33
import React from "react";
44
import "./Component.css";
5-
const AboutPage = (props) => {
5+
const AboutPage = () => {
66
return (
77
<div className="about-page">
88
<div className="app-stack">
99
<h2>Application Stack</h2>
1010
<p>
1111
This application implements each of the{" "}
12-
<a href="https://platform.openai.com/examples" target="_blank">
12+
<a
13+
href="https://platform.openai.com/examples"
14+
target="_blank"
15+
rel="noreferrer"
16+
>
1317
30 Code Samples
1418
</a>{" "}
1519
as found in the OpenAI API official documentation. Created with{" "}
16-
<a href="https://react.dev/" target="_blank">
20+
<a href="https://react.dev/" target="_blank" rel="noreferrer">
1721
React
1822
</a>{" "}
1923
leveraging{" "}
2024
<a
2125
href="https://www.npmjs.com/package/@chatscope/chat-ui-kit-react"
2226
target="_blank"
27+
rel="noreferrer"
2328
>
2429
@chatscope/chat-ui-kit-react
2530
</a>{" "}
2631
and{" "}
2732
<a
2833
href="https://www.npmjs.com/package/react-pro-sidebar"
2934
target="_blank"
35+
rel="noreferrer"
3036
>
3137
react-pro-sidebar
3238
</a>{" "}
3339
running on{" "}
34-
<a href="https://aws.amazon.com/" target="_blank">
40+
<a href="https://aws.amazon.com/" target="_blank" rel="noreferrer">
3541
AWS
3642
</a>{" "}
3743
serverless infrastructure integrated to{" "}
3844
<a
3945
href="https://platform.openai.com/docs/api-reference?lang=python"
4046
target="_blank"
47+
rel="noreferrer"
4148
>
4249
OpenAI Python API
4350
</a>
@@ -46,6 +53,7 @@ const AboutPage = (props) => {
4653
<a
4754
href="https://github.com/FullStackWithLawrence/aws-openai"
4855
target="_blank"
56+
rel="noreferrer"
4957
>
5058
<img src="/app-stack.123.jpeg" />
5159
</a>
@@ -54,13 +62,18 @@ const AboutPage = (props) => {
5462
<a
5563
href="https://github.com/FullStackWithLawrence/aws-openai"
5664
target="_blank"
65+
rel="noreferrer"
5766
>
5867
https://github.com/FullStackWithLawrence/aws-openai
5968
</a>
6069
</div>
6170
</div>
6271
<hr />
63-
<a href="https://www.youtube.com/@FullStackWithLawrence" target="_blank">
72+
<a
73+
href="https://www.youtube.com/@FullStackWithLawrence"
74+
target="_blank"
75+
rel="noreferrer"
76+
>
6477
<div className="fswl"></div>
6578
</a>
6679
</div>

client/src/components/chatApp/Modal.jsx

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import ReactModal from "react-modal";
3+
import PropTypes from "prop-types";
34

45
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
56
import { faExclamation } from "@fortawesome/free-solid-svg-icons";
@@ -46,3 +47,10 @@ export function ChatModal(props) {
4647
</ReactModal>
4748
);
4849
}
50+
51+
ChatModal.propTypes = {
52+
isModalOpen: PropTypes.bool.isRequired,
53+
onCloseClick: PropTypes.func.isRequired,
54+
title: PropTypes.string.isRequired,
55+
message: PropTypes.string.isRequired,
56+
};

client/src/components/chatApp/errorBoundary.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React from "react";
2+
import PropTypes from "prop-types";
23

34
export class ErrorBoundary extends React.Component {
45
constructor(props) {
56
super(props);
67
this.state = { hasError: false };
78
}
89

9-
static getDerivedStateFromError(error) {
10+
static getDerivedStateFromError() {
1011
// Update state so the next render will show the fallback UI.
1112
return { hasError: true };
1213
}
@@ -25,3 +26,7 @@ export class ErrorBoundary extends React.Component {
2526
return this.props.children;
2627
}
2728
}
29+
30+
ErrorBoundary.propTypes = {
31+
children: PropTypes.node,
32+
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"@semantic-release/git": "^10.0.1",
99
"@semantic-release/github": "^9.2.3",
1010
"@semantic-release/release-notes-generator": "^12.1.0",
11+
"prettier": "^3.2.4",
1112
"typescript": "^5.2.2"
1213
},
1314
"dependencies": {

0 commit comments

Comments
 (0)