CODEBASE: Fix lint errors 2 (#1756)

This commit is contained in:
catloversg
2024-11-07 14:09:11 +07:00
committed by GitHub
parent e3c10e9f0f
commit 36c143b687
48 changed files with 267 additions and 146 deletions
+7 -3
View File
@@ -86,7 +86,7 @@ export function TerminalInput(): React.ReactElement {
function getSearchSuggestionPrespace() {
const currentPrefix = `[${Player.getCurrentServer().hostname} /${Terminal.cwd()}]> `;
const prefixLength = `${currentPrefix}${value}`.length;
return Array(prefixLength).fill(" ");
return Array<string>(prefixLength).fill(" ");
}
function modifyInput(mod: Modification): void {
@@ -206,7 +206,7 @@ export function TerminalInput(): React.ReactElement {
return () => document.removeEventListener("keydown", keyDown);
});
async function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): Promise<void> {
async function onKeyDown(event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>): Promise<void> {
const ref = terminalInput.current;
// Run command or insert newline
@@ -427,7 +427,11 @@ export function TerminalInput(): React.ReactElement {
setPossibilities([]);
resetSearch();
},
onKeyDown: onKeyDown,
onKeyDown: (event) => {
onKeyDown(event).catch((error) => {
console.error(error);
});
},
}}
></TextField>
<Popper