Skip to content

Commit 66f22e4

Browse files
fixing lint errors (#17156)
1 parent f4babd3 commit 66f22e4

16 files changed

+33
-32
lines changed

components/dashboard/src/admin/License.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import { getGitpodService } from "../service/service";
1111
import { ReactComponent as Alert } from "../images/exclamation.svg";
1212
import { ReactComponent as Success } from "../images/check-circle.svg";
1313
import { LicenseInfo } from "@gitpod/gitpod-protocol";
14-
import { ReactComponent as XSvg } from "../images/x.svg";
15-
import { ReactComponent as CheckSvg } from "../images/check.svg";
16-
import { ReactComponent as LinkSvg } from "../images/external-link.svg";
1714
import SolidCard from "../components/SolidCard";
1815
import Card from "../components/Card";
1916
import { isGitpodIo } from "../utils";

components/dashboard/src/admin/ProjectsSearch.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export function ProjectsSearch() {
5050
} else {
5151
setCurrentProject(undefined);
5252
}
53+
// eslint-disable-next-line react-hooks/exhaustive-deps
5354
}, [location]);
5455

5556
useEffect(() => {

components/dashboard/src/admin/Settings.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export default function Settings() {
4444
const setting = await getGitpodService().server.adminGetSettings();
4545
setAdminSettings(setting);
4646
})();
47+
// eslint-disable-next-line react-hooks/exhaustive-deps
4748
}, []);
4849

4950
const actuallySetTelemetryPrefs = async (value: InstallationAdminSettings) => {

components/dashboard/src/admin/TeamsSearch.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export function TeamsSearch() {
5252
} else {
5353
setCurrentTeam(undefined);
5454
}
55+
// eslint-disable-next-line react-hooks/exhaustive-deps
5556
}, [location]);
5657

5758
if (currentTeam) {

components/dashboard/src/admin/UserDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ function renderBillingModeProperty(billingMode?: BillingMode): JSX.Element {
473473
>
474474
<p className="flex justify-left text-gitpod-red">
475475
<span>UBP blocked by:</span>
476-
<img className="m-2" src={CaretDown} />
476+
<img className="m-2" src={CaretDown} alt="caret icon pointing down" />
477477
</p>
478478
</ContextMenu>
479479
)}

components/dashboard/src/admin/UserSearch.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export default function UserSearch() {
4040
} else {
4141
setCurrentUserState(undefined);
4242
}
43+
// eslint-disable-next-line react-hooks/exhaustive-deps
4344
}, [location]);
4445

4546
if (currentUser) {

components/dashboard/src/admin/WorkspacesSearch.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@ export function WorkspaceSearch(props: Props) {
6666
} else {
6767
setCurrentWorkspaceState(undefined);
6868
}
69+
// eslint-disable-next-line react-hooks/exhaustive-deps
6970
}, [location]);
7071

7172
useEffect(() => {
7273
if (props.user) {
7374
search();
7475
}
76+
// eslint-disable-next-line react-hooks/exhaustive-deps
7577
}, [props.user]);
7678

7779
if (currentWorkspace) {

components/dashboard/src/components/ConfirmationModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default function ConfirmationModal(props: {
3535
const buttonDisabled = useRef(props.buttonDisabled);
3636
useEffect(() => {
3737
buttonDisabled.current = props.buttonDisabled;
38+
// eslint-disable-next-line react-hooks/exhaustive-deps
3839
}, []);
3940

4041
return (

components/dashboard/src/components/ContextMenu.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ export interface ContextMenuEntry {
3636
function ContextMenu(props: ContextMenuProps) {
3737
const [expanded, setExpanded] = useState(false);
3838

39-
const { changeMenuState } = props;
40-
41-
useEffect(() => {
42-
return () => {
43-
if (changeMenuState) {
44-
changeMenuState(!expanded);
45-
}
46-
};
47-
}, [expanded]);
48-
4939
const toggleExpanded = () => {
5040
setExpanded(!expanded);
5141
if (props.changeMenuState) {
@@ -80,6 +70,7 @@ function ContextMenu(props: ContextMenuProps) {
8070
window.removeEventListener("keydown", keydownHandler);
8171
window.removeEventListener("click", clickHandler);
8272
};
73+
// eslint-disable-next-line react-hooks/exhaustive-deps
8374
}, []); // Empty array ensures that effect is only run on mount and unmount
8475

8576
// Default 'children' is the three dots hamburger button.

components/dashboard/src/components/DropDown2.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const DropDown2: FunctionComponent<DropDown2Props> = (props) => {
108108
e.preventDefault();
109109
}
110110
},
111-
[filteredOptions, props, selectedElementTemp, setFocussedElement, showDropDown, toggleDropDown],
111+
[filteredOptions, props, search, selectedElementTemp, setFocussedElement, showDropDown, toggleDropDown],
112112
);
113113

114114
const handleBlur = useCallback(

components/dashboard/src/components/InfoBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function InfoBox(p: { className?: string; children?: React.ReactN
1414
(p.className || "")
1515
}
1616
>
17-
<img className="w-4 h-4 m-1 ml-2 mr-4" src={info} />
17+
<img className="w-4 h-4 m-1 ml-2 mr-4" src={info} alt="info icon" />
1818
<span>{p.children}</span>
1919
</div>
2020
);

components/dashboard/src/components/MonacoEditor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export default function MonacoEditor(props: MonacoEditorProps) {
7878
});
7979
}
8080
return () => editorRef.current?.dispose();
81+
// eslint-disable-next-line react-hooks/exhaustive-deps
8182
}, []);
8283

8384
useEffect(() => {

components/dashboard/src/components/PendingChangesDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default function PendingChangesDropdown(props: { workspaceInstance?: Work
4646
<span>
4747
{totalChanges} Change{totalChanges === 1 ? "" : "s"}
4848
</span>
49-
<img className="m-2" src={CaretDown} />
49+
<img className="m-2" src={CaretDown} alt="caret icon pointing down" />
5050
</p>
5151
</ContextMenu>
5252
);

components/dashboard/src/components/PrebuildLogs.tsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import EventEmitter from "events";
8-
import React, { Suspense, useEffect, useState } from "react";
8+
import React, { Suspense, useCallback, useEffect, useState } from "react";
99
import {
1010
WorkspaceInstance,
1111
DisposableCollection,
@@ -32,18 +32,21 @@ export default function PrebuildLogs(props: PrebuildLogsProps) {
3232
const [logsEmitter] = useState(new EventEmitter());
3333
const [prebuild, setPrebuild] = useState<PrebuildWithStatus | undefined>();
3434

35-
function handlePrebuildUpdate(prebuild: PrebuildWithStatus) {
36-
if (prebuild.info.buildWorkspaceId === props.workspaceId) {
37-
setPrebuild(prebuild);
35+
const handlePrebuildUpdate = useCallback(
36+
(prebuild: PrebuildWithStatus) => {
37+
if (prebuild.info.buildWorkspaceId === props.workspaceId) {
38+
setPrebuild(prebuild);
3839

39-
// In case the Prebuild got "aborted" or "time(d)out" we want to user to proceed anyway
40-
if (props.onIgnorePrebuild && (prebuild.status === "aborted" || prebuild.status === "timeout")) {
41-
props.onIgnorePrebuild();
40+
// In case the Prebuild got "aborted" or "time(d)out" we want to user to proceed anyway
41+
if (props.onIgnorePrebuild && (prebuild.status === "aborted" || prebuild.status === "timeout")) {
42+
props.onIgnorePrebuild();
43+
}
44+
// TODO(gpl) We likely want to move the "happy path" logic (for status "available")
45+
// here as well at some point. For that to work we need a "registerPrebuildUpdate(prebuildId)" API
4246
}
43-
// TODO(gpl) We likely want to move the "happy path" logic (for status "available")
44-
// here as well at some point. For that to work we need a "registerPrebuildUpdate(prebuildId)" API
45-
}
46-
}
47+
},
48+
[props],
49+
);
4750

4851
useEffect(() => {
4952
const disposables = new DisposableCollection();
@@ -105,7 +108,7 @@ export default function PrebuildLogs(props: PrebuildLogsProps) {
105108
return function cleanup() {
106109
disposables.dispose();
107110
};
108-
}, [logsEmitter, props.workspaceId]);
111+
}, [handlePrebuildUpdate, logsEmitter, props.workspaceId]);
109112

110113
useEffect(() => {
111114
const workspaceId = props.workspaceId;

components/dashboard/src/components/WorkspaceLogs.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export default function WorkspaceLogs(props: WorkspaceLogsProps) {
5656
return function cleanUp() {
5757
terminal.dispose();
5858
};
59+
// eslint-disable-next-line react-hooks/exhaustive-deps
5960
}, []);
6061

6162
useEffect(() => {
@@ -70,19 +71,22 @@ export default function WorkspaceLogs(props: WorkspaceLogsProps) {
7071
clearTimeout(timeout!);
7172
window.removeEventListener("resize", onWindowResize);
7273
};
74+
// eslint-disable-next-line react-hooks/exhaustive-deps
7375
}, []);
7476

7577
useEffect(() => {
7678
if (terminalRef.current && props.errorMessage) {
7779
terminalRef.current.write(`\r\n\u001b[38;5;196m${props.errorMessage}\u001b[0m\r\n`);
7880
}
81+
// eslint-disable-next-line react-hooks/exhaustive-deps
7982
}, [terminalRef.current, props.errorMessage]);
8083

8184
useEffect(() => {
8285
if (!terminalRef.current) {
8386
return;
8487
}
8588
terminalRef.current.setOption("theme", isDark ? darkTheme : lightTheme);
89+
// eslint-disable-next-line react-hooks/exhaustive-deps
8690
}, [terminalRef.current, isDark]);
8791

8892
return (

components/dashboard/src/user-settings/selectClass.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
* See License.AGPL.txt in the project root for license information.
55
*/
66

7-
import { useEffect, useState } from "react";
8-
import { getGitpodService } from "../service/service";
7+
import { useState } from "react";
98
import { trackEvent } from "../Analytics";
109
import WorkspaceClass from "../components/WorkspaceClass";
11-
import { SupportedWorkspaceClass } from "@gitpod/gitpod-protocol/lib/workspace-class";
1210
import { useWorkspaceClasses } from "../data/workspaces/workspace-classes-query";
1311

1412
interface SelectWorkspaceClassProps {

0 commit comments

Comments
 (0)