Skip to content

Commit 1378d38

Browse files
committed
Fix: further linting issues
1 parent 24cced1 commit 1378d38

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/ImageBuilder.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useState, useRef, useContext, useMemo, KeyboardEventHandler,
22
Dispatch, SetStateAction,
3-
} from "react";
3+
} from "react";
44
import { type Terminal } from "xterm";
55
import { type FitAddon } from "xterm-addon-fit";
66

@@ -122,19 +122,20 @@ export function ImageBuilder({ name, isActive, optionKey }: ICustomOptionProps)
122122
const { repo, repoId, repoFieldProps, repoError } =
123123
useRepositoryField(binderRepo);
124124
const { getRepositoryOptions, getRefOptions, removeRefOption, removeRepositoryOption,
125-
setBuildImageStart } = useFormCache();
125+
setBuildImageStart } = useFormCache();
126126

127127
const [ref, setRef] = useState<string>(repoRef || "HEAD");
128128
const repoFieldRef = useRef<HTMLInputElement>();
129129
const branchFieldRef = useRef<HTMLInputElement>();
130130

131131
const [customImage, setCustomImage] = useState<string>("");
132-
const [customImageError, setCustomImageError] = useState<string>(null);
132+
const [customImageError] = useState<string>(null);
133133

134134
const [term, setTerm] = useState<Terminal>(null);
135135
const [fitAddon, setFitAddon] = useState<FitAddon>(null);
136136

137-
const [isBuildingImage, setIsBuildingImage] = useState<boolean>(false);
137+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
138+
const [_isBuildingImage, setIsBuildingImage] = useState<boolean>(false);
138139

139140
const hrefReop = useRef<string>(repo);
140141
const hrefRef = useRef<string>(ref);
@@ -170,7 +171,6 @@ export function ImageBuilder({ name, isActive, optionKey }: ICustomOptionProps)
170171
}
171172

172173
const handleBuildStart = async () => {
173-
174174
if (repoFieldRef.current && !hrefReop.current) {
175175
repoFieldRef.current.focus();
176176
repoFieldRef.current.blur();
@@ -186,7 +186,7 @@ export function ImageBuilder({ name, isActive, optionKey }: ICustomOptionProps)
186186
try {
187187
hrefSetIsBuildingImage.current(true);
188188
const imageName = await buildImage(hrefRepoId.current, hrefRef.current,
189-
hrefTerm.current, hrefFitAddon.current);
189+
hrefTerm.current, hrefFitAddon.current);
190190
//console.log("handleBuildStart: step 4", imageName);
191191
hrefSetCustomImage.current(imageName);
192192
hrefTerm.current.write("\nImage has been built! Starting your server...");
@@ -200,11 +200,11 @@ export function ImageBuilder({ name, isActive, optionKey }: ICustomOptionProps)
200200
};
201201

202202
useEffect(() => {
203-
setBuildImageStart(() => handleBuildStart);
204-
return () => {
205-
setBuildImageStart(null);
206-
};
207-
}, []);
203+
setBuildImageStart(() => handleBuildStart);
204+
return () => {
205+
setBuildImageStart(null);
206+
};
207+
}, []);
208208

209209
const handleKeyDown: KeyboardEventHandler<HTMLInputElement> = (e) => {
210210
if (e.key === "Enter") {

src/ProfileForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function Form() {
5454
await buildImageStart();
5555
}
5656
setShouldSubmit(true);
57-
}
57+
};
5858

5959

6060
const submitTheForm = () => {
@@ -135,10 +135,10 @@ function Form() {
135135
if (permalinkValues["autoStart"] === "true") {
136136
const form = document.querySelector("form");
137137
if (form) {
138-
const button = form.querySelector('button[type="submit"]') as HTMLButtonElement | null;
138+
const button = form.querySelector("button[type=\"submit\"]") as HTMLButtonElement | null;
139139
if (button) {
140140
setTimeout(() => {
141-
button.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));
141+
button.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true }));
142142
}, 1000); // Give the form a second to render, and the profile to be selected, HACK but it works
143143
}
144144
}

src/context/FormCache.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export const FormCacheProvider = ({ children }: PropsWithChildren) => {
158158
loadPreviousRepositories();
159159
}, []);
160160

161-
const [buildImageStart, setBuildImageStart] = useState<(() => Promise<void>) | null>(null);
161+
const [buildImageStart, setBuildImageStart] = useState<(() => Promise<void>) | null>(null);
162162

163163
const contextValue = {
164164
getChoiceOptions,

0 commit comments

Comments
 (0)