CODEBASE: Fix lint errors 3 (#1758)

This is a really big refactor because it actually *fixes* a lot of the lint errors instead of disabling them.
This commit is contained in:
catloversg
2024-11-14 23:18:57 +07:00
committed by GitHub
parent 97ca8c5f5e
commit 75cf9c88b5
31 changed files with 187 additions and 51 deletions

View File

@@ -82,14 +82,14 @@ export function NetscriptUserInterface(): InternalAPI<IUserInterface> {
setStyles: (ctx) => (newStyles) => {
const styleValidator: Record<string, string | number | undefined> = {};
assertObjectType(ctx, "newStyles", newStyles, styleValidator);
const currentStyles = { ...Settings.styles };
const currentStyles: Record<string, unknown> = { ...Settings.styles };
const errors: string[] = [];
for (const key of Object.keys(newStyles)) {
if (!(currentStyles as any)[key]) {
if (!currentStyles[key]) {
// Invalid key
errors.push(`Invalid key "${key}"`);
} else {
(currentStyles as any)[key] = newStyles[key];
currentStyles[key] = newStyles[key];
}
}