CODEBASE: Fix lint errors 1 (#1732)

This commit is contained in:
catloversg
2024-11-04 13:35:14 +07:00
committed by GitHub
parent f7ee3a340f
commit f6502dd490
55 changed files with 252 additions and 255 deletions
+7 -2
View File
@@ -33,6 +33,7 @@ import { useCallback } from "react";
import { type AST, getFileType, parseAST } from "../../utils/ScriptTransformer";
import { RamCalculationErrorCode } from "../../Script/RamCalculationErrorCodes";
import { hasScriptExtension, isLegacyScript } from "../../Paths/ScriptFilePath";
import { exceptionAlert } from "../../utils/helpers/exceptionAlert";
interface IProps {
// Map of filename -> code
@@ -105,7 +106,9 @@ function Root(props: IProps): React.ReactElement {
const server = GetServer(currentScript.hostname);
if (server === null) throw new Error("Server should not be null but it is.");
server.writeToContentFile(currentScript.path, currentScript.code);
if (Settings.SaveGameOnFileSave) saveObject.saveGame();
if (Settings.SaveGameOnFileSave) {
saveObject.saveGame().catch((error) => exceptionAlert(error));
}
rerender();
}, [rerender]);
@@ -285,7 +288,9 @@ function Root(props: IProps): React.ReactElement {
if (!server) throw new Error("Server should not be null but it is.");
// This server helper already handles overwriting, etc.
server.writeToContentFile(scriptToSave.path, scriptToSave.code);
if (Settings.SaveGameOnFileSave) saveObject.saveGame();
if (Settings.SaveGameOnFileSave) {
saveObject.saveGame().catch((error) => exceptionAlert(error));
}
}
function currentTabIndex(): number | undefined {
+4 -1
View File
@@ -35,7 +35,10 @@ export function Toolbar({ editor, onSave }: IProps) {
const [optionsOpen, { on: openOptions, off: closeOptions }] = useBoolean(false);
function beautify(): void {
editor?.getAction("editor.action.formatDocument")?.run();
editor
?.getAction("editor.action.formatDocument")
?.run()
.catch((error) => console.error(error));
}
const { ram, ramEntries, isUpdatingRAM, options, saveOptions } = useScriptEditorContext();
+1 -1
View File
@@ -218,7 +218,7 @@ export function makeTheme(theme: IScriptEditorTheme): editor.IStandaloneThemeDat
return { base: theme.base, inherit: theme.inherit, rules: themeRules, colors: themeColors };
}
export async function loadThemes(defineTheme: DefineThemeFn): Promise<void> {
export function loadThemes(defineTheme: DefineThemeFn): void {
defineTheme("monokai", {
base: "vs-dark",
inherit: true,