Skip to content

Commit 713caf3

Browse files
committed
Fix lint errors
1 parent dcaea59 commit 713caf3

File tree

16 files changed

+58
-66
lines changed

16 files changed

+58
-66
lines changed

web/src/api/axios.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const axiosInstance = axios.create({
1010
});
1111

1212
axiosInstance.interceptors.request.use(async (request) => {
13+
/* eslint-disable @typescript-eslint/no-explicit-any */
1314
if ((window as any).Clerk.session) {
1415
const token = await (window as any).Clerk.session.getToken();
1516
if (token) {

web/src/app/projects/[project-id]/edit/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default function ProjectEdit() {
4646

4747
useEffect(() => {
4848
loadProject();
49-
}, [projectId]);
49+
});
5050

5151
const onUpdateProject = (event: MouseEvent<HTMLButtonElement>) => {
5252
event.preventDefault();
@@ -91,7 +91,7 @@ export default function ProjectEdit() {
9191
p: 3,
9292
}}
9393
>
94-
<Heading>Edit Project</Heading>
94+
<Heading as={"h2"}>Edit Project</Heading>
9595
<Text sx={{ color: "fg.muted" }}>
9696
Your mocked endpoints are grouped into projects for better
9797
organization.

web/src/app/projects/[project-id]/endpoints/[endpoint-id]/edit/page.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default function EndpointsEdit() {
100100
};
101101
useEffect(() => {
102102
loadProjectEndpoint();
103-
}, [projectId, projectEndpointId]);
103+
});
104104

105105
const loadProject = () => {
106106
showProject(projectId).then((project: EntitiesProject) => {
@@ -109,7 +109,7 @@ export default function EndpointsEdit() {
109109
};
110110
useEffect(() => {
111111
loadProject();
112-
}, [projectId]);
112+
});
113113

114114
const onDeleteDialogClose = useCallback(
115115
() => setIsDeleteDialogOpen(false),
@@ -155,7 +155,7 @@ export default function EndpointsEdit() {
155155
p: 3,
156156
}}
157157
>
158-
<Heading>Update Mock Endpoint</Heading>
158+
<Heading as={"h2"}>Update Mock Endpoint</Heading>
159159
<FormControl sx={{ mt: 4 }} required={true} disabled={loading}>
160160
<FormControl.Label>Request Method</FormControl.Label>
161161
<FormControl.Caption>
@@ -380,13 +380,13 @@ export default function EndpointsEdit() {
380380
},
381381
]}
382382
>
383-
<Box>
384-
<Text>
383+
<div>
384+
<p>
385385
Are you sure you want to delete the{" "}
386386
<BranchName>{endpoint.request_path}</BranchName> endpoint. This is
387387
a permanent action and it cannot be reversed.
388-
</Text>
389-
</Box>
388+
</p>
389+
</div>
390390
<Box sx={{ mt: 2 }}>
391391
<Text sx={{ color: "fg.muted" }}>{endpoint.description}</Text>
392392
</Box>

web/src/app/projects/[project-id]/endpoints/[endpoint-id]/page.tsx

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export default function EndpointShow() {
2323
const pathName = usePathname();
2424
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);
2525
const { showProject, showProjectEndpoint } = useAppStore((state) => state);
26-
const [loading, setLoading] = useState<boolean>(false);
2726
const [loadingEndpoint, setLoadingEndpoint] = useState<boolean>(false);
2827
const [project, setProject] = useState<EntitiesProject | undefined>(
2928
undefined,
@@ -52,7 +51,7 @@ export default function EndpointShow() {
5251
};
5352
useEffect(() => {
5453
loadProjectEndpoint();
55-
}, [projectId, projectEndpointId]);
54+
});
5655

5756
const loadProject = () => {
5857
showProject(projectId).then((project: EntitiesProject) => {
@@ -61,7 +60,7 @@ export default function EndpointShow() {
6160
};
6261
useEffect(() => {
6362
loadProject();
64-
}, [projectId]);
63+
});
6564

6665
return (
6766
<Box
@@ -72,8 +71,8 @@ export default function EndpointShow() {
7271
minHeight: "calc(100vh - 200px)",
7372
}}
7473
>
75-
<PageHeader role="banner" aria-label="project details">
76-
<PageHeader.TitleArea variant={"large"}>
74+
<PageHeader role="banner" aria-label="Project details">
75+
<PageHeader.TitleArea aria-label={"Project endpoint"} variant={"large"}>
7776
{project && projectEndpoint && (
7877
<PageHeader.Title>
7978
<Box sx={{ display: "flex", alignItems: "baseline" }}>
@@ -123,26 +122,26 @@ export default function EndpointShow() {
123122
title={`Delete ${project?.name}`}
124123
footerButtons={[
125124
{
126-
disabled: loading,
125+
disabled: loadingEndpoint,
127126
content: "Close",
128127
onClick: onDeleteDialogClose,
129128
},
130129
{
131130
buttonType: "danger",
132131
block: true,
133-
loading: loading,
134-
disabled: loading,
132+
loading: loadingEndpoint,
133+
disabled: loadingEndpoint,
135134
content: "Delete this Request",
136135
},
137136
]}
138137
>
139-
<Box>
140-
<Text>
138+
<div>
139+
<p>
141140
Are you sure you want to delete the{" "}
142141
<BranchName>{project?.name}</BranchName> project. This is a
143142
permanent action and it cannot be reversed.
144-
</Text>
145-
</Box>
143+
</p>
144+
</div>
146145
<Box sx={{ mt: 2 }}>
147146
<Text sx={{ color: "fg.muted" }}>
148147
{project?.subdomain}.httpmock.dev
@@ -151,15 +150,15 @@ export default function EndpointShow() {
151150
</Dialog>
152151
)}
153152

154-
<Box>
153+
<div>
155154
<Heading as="h2" sx={{ mt: 32 }} variant="medium">
156155
<MirrorIcon size={24} />
157156
<Text sx={{ ml: 2 }}>HTTP Requests</Text>
158157
</Heading>
159-
</Box>
160-
<Box>
158+
</div>
159+
<div>
161160
<Spinner size="large" />
162-
</Box>
161+
</div>
163162
</Box>
164163
);
165164
}

web/src/app/projects/[project-id]/endpoints/create/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default function EndpointsCreate() {
7777

7878
useEffect(() => {
7979
loadProject();
80-
}, [projectId]);
80+
});
8181

8282
return (
8383
<Box
@@ -100,7 +100,7 @@ export default function EndpointsCreate() {
100100
p: 3,
101101
}}
102102
>
103-
<Heading>Create Mock Endpoint</Heading>
103+
<Heading as={"h2"}>Create Mock Endpoint</Heading>
104104
<FormControl sx={{ mt: 4 }} required={true} disabled={loading}>
105105
<FormControl.Label>Request Method</FormControl.Label>
106106
<FormControl.Caption>

web/src/app/projects/[project-id]/page.tsx

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@ import {
1212
BranchName,
1313
Heading,
1414
Label,
15-
LabelColorOptions,
16-
StateLabel,
1715
RelativeTime,
1816
} from "@primer/react";
1917
import { usePathname, useRouter } from "next/navigation";
2018
import { useCallback, useEffect, MouseEvent, useState } from "react";
21-
import { ErrorMessages } from "@/utils/errors";
2219
import { useAppStore } from "@/store/provider";
2320
import { EntitiesProject, EntitiesProjectEndpoint } from "@/api/model";
2421
import {
25-
CopyIcon,
2622
GearIcon,
2723
LinkIcon,
2824
PencilIcon,
@@ -66,7 +62,7 @@ export default function ProjectShow() {
6662

6763
useEffect(() => {
6864
loadProject();
69-
}, [projectId]);
65+
});
7066

7167
const loadProjectEndpoints = () => {
7268
setLoadingEndpoints(true);
@@ -81,7 +77,7 @@ export default function ProjectShow() {
8177

8278
useEffect(() => {
8379
loadProjectEndpoints();
84-
}, [projectId]);
80+
});
8581

8682
const onDeleteProject = async (event: MouseEvent) => {
8783
event.preventDefault();
@@ -129,7 +125,7 @@ export default function ProjectShow() {
129125
minHeight: "calc(100vh - 200px)",
130126
}}
131127
>
132-
<PageHeader role="banner" aria-label="project details">
128+
<PageHeader role="banner" aria-label="Project details">
133129
<PageHeader.TitleArea variant={"large"}>
134130
{project && (
135131
<PageHeader.Title>{project && project.name}</PageHeader.Title>
@@ -165,7 +161,7 @@ export default function ProjectShow() {
165161
<ActionMenu.Overlay>
166162
<ActionList>
167163
<ActionList.Item
168-
onClick={() => router.push(`/projects/${projectId}/edit`)}
164+
onSelect={() => router.push(`/projects/${projectId}/edit`)}
169165
>
170166
Edit Project
171167
<ActionList.LeadingVisual>
@@ -216,13 +212,13 @@ export default function ProjectShow() {
216212
},
217213
]}
218214
>
219-
<Box>
220-
<Text>
215+
<div>
216+
<p>
221217
Are you sure you want to delete the{" "}
222218
<BranchName>{project?.name}</BranchName> project. This is a
223219
permanent action and it cannot be reversed.
224-
</Text>
225-
</Box>
220+
</p>
221+
</div>
226222
<Box sx={{ mt: 2 }}>
227223
<Text sx={{ color: "fg.muted" }}>
228224
{project?.subdomain}.httpmock.dev
@@ -231,16 +227,16 @@ export default function ProjectShow() {
231227
</Dialog>
232228
)}
233229

234-
<Box>
230+
<div>
235231
<Heading as="h2" sx={{ mt: 32 }} variant="medium">
236232
<LinkIcon size={24} />
237233
<Text sx={{ ml: 2 }}>Endpoints</Text>
238234
</Heading>
239-
</Box>
235+
</div>
240236
{loadingEndpoints && (
241-
<Box>
237+
<div>
242238
<Spinner size="large" />
243-
</Box>
239+
</div>
244240
)}
245241
{!loadingEndpoints && (
246242
<Box
@@ -268,7 +264,7 @@ export default function ProjectShow() {
268264
}}
269265
>
270266
{endpoints.map((endpoint) => (
271-
<Box key={endpoint.id}>
267+
<div key={endpoint.id}>
272268
<Box sx={{ display: "flex", alignItems: "baseline" }}>
273269
<Label sx={{ color: getLabelColor(endpoint.request_method) }}>
274270
{endpoint.request_method}
@@ -304,7 +300,7 @@ export default function ProjectShow() {
304300
>
305301
Manage
306302
</Button>
307-
<Box>
303+
<div>
308304
<Text size="small" sx={{ mr: 1, color: "fg.muted" }}>
309305
Updated
310306
</Text>
@@ -313,9 +309,9 @@ export default function ProjectShow() {
313309
date={new Date(endpoint.updated_at)}
314310
noTitle={true}
315311
></RelativeTime>
316-
</Box>
312+
</div>
317313
</Box>
318-
</Box>
314+
</div>
319315
))}
320316
</Box>
321317
)}

web/src/app/projects/create/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default function ProjectCreate() {
7171
p: 3,
7272
}}
7373
>
74-
<Heading>Create Project</Heading>
74+
<Heading as={"h2"}>Create Project</Heading>
7575
<Text sx={{ color: "fg.muted" }}>
7676
Your mocked endpoints are grouped into projects for better
7777
organization.

web/src/app/projects/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function ProjectIndex() {
3434

3535
useEffect(() => {
3636
loadProjects();
37-
}, []);
37+
});
3838

3939
return (
4040
<Box
@@ -45,7 +45,7 @@ export default function ProjectIndex() {
4545
minHeight: "calc(100vh - 200px)",
4646
}}
4747
>
48-
<PageHeader role="banner" aria-label="project list">
48+
<PageHeader role="banner" aria-label="Project list">
4949
<PageHeader.TitleArea variant={"large"}>
5050
All Projects
5151
</PageHeader.TitleArea>

web/src/app/user-profile/[[...user-profile]]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ export default function Page() {
1212
minHeight: "calc(100vh - 200px)",
1313
}}
1414
>
15-
<Box>
15+
<div>
1616
<BackButton href={"/"}></BackButton>
1717
<UserProfile path="/user-profile" />
18-
</Box>
18+
</div>
1919
</Box>
2020
);
2121
}

web/src/components/app-bar.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,13 @@
22

33
import * as React from "react";
44
import Image from "next/image";
5-
import {
6-
Header,
7-
Button,
8-
ActionMenu,
9-
ActionList,
10-
IconButton,
11-
Avatar,
12-
} from "@primer/react";
5+
import { Header, Button, ActionMenu, ActionList, Avatar } from "@primer/react";
136
import { Heading } from "@primer/react";
147
import Logo from "@/app/logo.svg";
158
import {
169
SignInIcon,
1710
SignOutIcon,
1811
PersonFillIcon,
19-
KebabHorizontalIcon,
2012
} from "@primer/octicons-react";
2113
import { usePathname, useRouter } from "next/navigation";
2214
import { useClerk, useUser } from "@clerk/nextjs";

0 commit comments

Comments
 (0)