mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
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:
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user