From d01fd55bdef0636ee09fff214e9f34bb88648aaf Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 21 Jul 2022 01:58:47 -0400 Subject: [PATCH] lint fmt --- src/Bladeburner/Bladeburner.tsx | 2 +- src/Corporation/ui/IndustryOffice.tsx | 2 +- src/Corporation/ui/modals/BuybackSharesModal.tsx | 7 +------ src/Crime/Crime.ts | 1 - src/NetscriptFunctions.ts | 1 - src/Script/RamCalculations.ts | 1 - src/ScriptEditor/ui/ScriptEditorRoot.tsx | 2 +- src/Work/{CrimeWork.tsx => CrimeWork.ts} | 1 - src/ui/GameRoot.tsx | 1 - 9 files changed, 4 insertions(+), 14 deletions(-) rename src/Work/{CrimeWork.tsx => CrimeWork.ts} (99%) diff --git a/src/Bladeburner/Bladeburner.tsx b/src/Bladeburner/Bladeburner.tsx index 44641ddaf..830549a20 100644 --- a/src/Bladeburner/Bladeburner.tsx +++ b/src/Bladeburner/Bladeburner.tsx @@ -794,7 +794,7 @@ export class Bladeburner implements IBladeburner { let i = 0; while (i < command.length) { const c = command.charAt(i); - if ((c === '"')||(c === "'")) { + if (c === '"' || c === "'") { // Double quotes or Single quotes const endQuote = command.indexOf(c, i + 1); if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === KEY.SPACE)) { diff --git a/src/Corporation/ui/IndustryOffice.tsx b/src/Corporation/ui/IndustryOffice.tsx index b48031e46..17760f36b 100644 --- a/src/Corporation/ui/IndustryOffice.tsx +++ b/src/Corporation/ui/IndustryOffice.tsx @@ -177,7 +177,7 @@ function EmployeeCount(props: { num: number; next: number }): React.ReactElement return ( {props.num === props.next ? null : props.num} - {props.num === props.next ? null : } + {props.num === props.next ? null : } {props.next} ); diff --git a/src/Corporation/ui/modals/BuybackSharesModal.tsx b/src/Corporation/ui/modals/BuybackSharesModal.tsx index def744d65..5d6b33e49 100644 --- a/src/Corporation/ui/modals/BuybackSharesModal.tsx +++ b/src/Corporation/ui/modals/BuybackSharesModal.tsx @@ -82,12 +82,7 @@ export function BuybackSharesModal(props: IProps): React.ReactElement {
- + diff --git a/src/Crime/Crime.ts b/src/Crime/Crime.ts index 6d80cf43b..65587b0c2 100644 --- a/src/Crime/Crime.ts +++ b/src/Crime/Crime.ts @@ -1,7 +1,6 @@ import { CONSTANTS } from "../Constants"; import { IPlayer } from "../PersonObjects/IPlayer"; import { IPerson } from "../PersonObjects/IPerson"; -import { IRouter } from "../ui/Router"; import { WorkerScript } from "../Netscript/WorkerScript"; import { CrimeType } from "../utils/WorkType"; import { CrimeWork } from "../Work/CrimeWork"; diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 940031bdb..9b3bb0617 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -637,7 +637,6 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { }; const singularity = NetscriptSingularity(Player, workerScript); - const base: InternalAPI = { args: workerScript.args as unknown as any, enums: { diff --git a/src/Script/RamCalculations.ts b/src/Script/RamCalculations.ts index 8d5f8af0d..7c69aff5b 100644 --- a/src/Script/RamCalculations.ts +++ b/src/Script/RamCalculations.ts @@ -12,7 +12,6 @@ import { RamCalculationErrorCode } from "./RamCalculationErrorCodes"; import { RamCosts, RamCostConstants } from "../Netscript/RamCostGenerator"; import { Script } from "./Script"; -import { WorkerScript } from "../Netscript/WorkerScript"; import { areImportsEquals } from "../Terminal/DirectoryHelpers"; import { IPlayer } from "../PersonObjects/IPlayer"; import { Node } from "../NetscriptJSEvaluator"; diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index 5bda6d49a..adce402e2 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -58,7 +58,7 @@ interface IProps { let symbolsLoaded = false; let symbols: string[] = []; export function SetupTextEditor(): void { - const ns = NetscriptFunctions({} as WorkerScript); + const ns = NetscriptFunctions({ args: [] } as unknown as WorkerScript); // Populates symbols for text editor function populate(ns: any): string[] { diff --git a/src/Work/CrimeWork.tsx b/src/Work/CrimeWork.ts similarity index 99% rename from src/Work/CrimeWork.tsx rename to src/Work/CrimeWork.ts index 1ac4ea2bd..ff957c0bb 100644 --- a/src/Work/CrimeWork.tsx +++ b/src/Work/CrimeWork.ts @@ -1,4 +1,3 @@ -import React from "react"; import { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from "../utils/JSONReviver"; import { Crime } from "../Crime/Crime"; import { CONSTANTS } from "../Constants"; diff --git a/src/ui/GameRoot.tsx b/src/ui/GameRoot.tsx index e3defc2a8..293038414 100644 --- a/src/ui/GameRoot.tsx +++ b/src/ui/GameRoot.tsx @@ -8,7 +8,6 @@ import { saveObject } from "../SaveObject"; import { onExport } from "../ExportBonus"; import { LocationName } from "../Locations/data/LocationNames"; import { Location } from "../Locations/Location"; -import { Locations } from "../Locations/Locations"; import { ITutorial, iTutorialStart } from "../InteractiveTutorial"; import { InteractiveTutorialRoot } from "./InteractiveTutorial/InteractiveTutorialRoot"; import { ITutorialEvents } from "./InteractiveTutorial/ITutorialEvents";