mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 17:53:00 +02:00
all the lints
This commit is contained in:
+14
-25
@@ -5,7 +5,6 @@ import * as libarg from 'arg';
|
||||
import { getRamCost } from "./Netscript/RamCostGenerator";
|
||||
import { WorkerScriptStartStopEventEmitter } from "./Netscript/WorkerScriptStartStopEventEmitter";
|
||||
|
||||
import { Augmentation } from "./Augmentation/Augmentation";
|
||||
import { Augmentations } from "./Augmentation/Augmentations";
|
||||
import {
|
||||
augmentationExists,
|
||||
@@ -17,7 +16,7 @@ import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers";
|
||||
import { findCrime } from "./Crime/CrimeHelpers";
|
||||
import { Bladeburner } from "./Bladeburner";
|
||||
import { Company } from "./Company/Company";
|
||||
import { Companies, companyExists } from "./Company/Companies";
|
||||
import { Companies } from "./Company/Companies";
|
||||
import { CompanyPosition } from "./Company/CompanyPosition";
|
||||
import { CompanyPositions } from "./Company/CompanyPositions";
|
||||
import { CONSTANTS } from "./Constants";
|
||||
@@ -35,8 +34,8 @@ import {
|
||||
AllGangs,
|
||||
GangMemberUpgrades,
|
||||
GangMemberTasks,
|
||||
Gang,
|
||||
} from "./Gang";
|
||||
import { Faction } from "./Faction/Faction";
|
||||
import { Factions, factionExists } from "./Faction/Factions";
|
||||
import { joinFaction, purchaseAugmentation } from "./Faction/FactionHelpers";
|
||||
import { FactionWorkType } from "./Faction/FactionWorkTypeEnum";
|
||||
@@ -74,7 +73,7 @@ import {
|
||||
calculateServerCost as HScalculateServerCost,
|
||||
} from "./Hacknet/formulas/HacknetServers";
|
||||
import { HacknetNodeConstants, HacknetServerConstants } from "./Hacknet/data/Constants";
|
||||
import { HacknetServer, MaxNumberHacknetServers } from "./Hacknet/HacknetServer";
|
||||
import { HacknetServer } from "./Hacknet/HacknetServer";
|
||||
import { CityName } from "./Locations/data/CityNames";
|
||||
import { LocationName } from "./Locations/data/LocationNames";
|
||||
import { Terminal } from "./Terminal";
|
||||
@@ -84,7 +83,6 @@ import {
|
||||
} from "./PersonObjects/formulas/skill";
|
||||
|
||||
import { Message } from "./Message/Message";
|
||||
import { Messages } from "./Message/MessageHelpers";
|
||||
import { inMission } from "./Missions";
|
||||
import { Player } from "./Player";
|
||||
import { Programs } from "./Programs/Programs";
|
||||
@@ -94,15 +92,12 @@ import {
|
||||
findRunningScriptByPid,
|
||||
} from "./Script/ScriptHelpers";
|
||||
import { isScriptFilename } from "./Script/ScriptHelpersTS";
|
||||
import { _getScriptUrls } from "./NetscriptJSEvaluator";
|
||||
import {
|
||||
AllServers,
|
||||
AddToAllServers,
|
||||
createUniqueRandomIp,
|
||||
} from "./Server/AllServers";
|
||||
import { RunningScript } from "./Script/RunningScript";
|
||||
import { startWorkerScript } from "./NetscriptWorker";
|
||||
import { Server } from "./Server/Server";
|
||||
import {
|
||||
GetServerByHostname,
|
||||
getServer,
|
||||
@@ -116,7 +111,6 @@ import {
|
||||
getPurchaseServerLimit,
|
||||
getPurchaseServerMaxRam,
|
||||
} from "./Server/ServerPurchases";
|
||||
import { Settings } from "./Settings/Settings";
|
||||
import { SpecialServerIps } from "./Server/SpecialServerIps";
|
||||
import { SourceFileFlags } from "./SourceFile/SourceFileFlags";
|
||||
import {
|
||||
@@ -129,7 +123,6 @@ import {
|
||||
influenceStockThroughServerHack,
|
||||
influenceStockThroughServerGrow,
|
||||
} from "./StockMarket/PlayerInfluencing";
|
||||
import { Stock } from "./StockMarket/Stock";
|
||||
import {
|
||||
StockMarket,
|
||||
SymbolToStockMap,
|
||||
@@ -151,13 +144,10 @@ import {
|
||||
import { isValidFilePath } from "./Terminal/DirectoryHelpers";
|
||||
import { TextFile, getTextFile, createTextFile } from "./TextFile";
|
||||
|
||||
import {
|
||||
unknownBladeburnerActionErrorMessage,
|
||||
} from"./NetscriptBladeburner";
|
||||
import { Gang } from "./Gang";
|
||||
import {
|
||||
NetscriptPorts,
|
||||
runScriptFromScript,
|
||||
startWorkerScript,
|
||||
} from "./NetscriptWorker";
|
||||
import { killWorkerScript } from "./Netscript/killWorkerScript";
|
||||
import { workerScripts } from "./Netscript/WorkerScripts";
|
||||
@@ -172,18 +162,17 @@ import { SleeveTaskType } from "./PersonObjects/Sleeve/SleeveTaskTypesEnum";
|
||||
import { findSleevePurchasableAugs } from "./PersonObjects/Sleeve/SleeveHelpers";
|
||||
import { Exploit } from './Exploits/Exploit.ts';
|
||||
|
||||
import { Page, routing } from "./ui/navigationTracking";
|
||||
import { numeralWrapper } from "./ui/numeralFormat";
|
||||
import { post } from "./ui/postToTerminal";
|
||||
import { setTimeoutRef } from "./utils/SetTimeoutRef";
|
||||
import { is2DArray } from "./utils/helpers/is2DArray";
|
||||
import { convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions";
|
||||
import {
|
||||
formatNumber,
|
||||
convertTimeMsToTimeElapsedString,
|
||||
} from "../utils/StringHelperFunctions";
|
||||
|
||||
import { dialogBoxCreate } from "../utils/DialogBox";
|
||||
import { formatNumber, isHTML } from "../utils/StringHelperFunctions";
|
||||
import { logBoxCreate } from "../utils/LogBox";
|
||||
import { arrayToString } from "../utils/helpers/arrayToString";
|
||||
import { isPowerOfTwo } from "../utils/helpers/isPowerOfTwo";
|
||||
import { isString } from "../utils/helpers/isString";
|
||||
|
||||
import { createElement } from "../utils/uiHelpers/createElement";
|
||||
@@ -261,7 +250,7 @@ const possibleLogs = {
|
||||
setTerritoryWarfare: true,
|
||||
}
|
||||
|
||||
const defaultInterpreter = new Interpreter('', function(){});
|
||||
const defaultInterpreter = new Interpreter('', () => undefined);
|
||||
|
||||
// the acorn interpreter has a bug where it doesn't convert arrays correctly.
|
||||
// so we have to more or less copy it here.
|
||||
@@ -2468,21 +2457,21 @@ function NetscriptFunctions(workerScript) {
|
||||
threads: runningScript.threads,
|
||||
};
|
||||
},
|
||||
getHackTime: function(ip, hack, int) {
|
||||
getHackTime: function(ip) {
|
||||
updateDynamicRam("getHackTime", getRamCost("getHackTime"));
|
||||
const server = safeGetServer(ip, "getHackTime");
|
||||
if (failOnHacknetServer(server, "getHackTime")) { return Infinity; }
|
||||
|
||||
return calculateHackingTime(server, Player); // Returns seconds
|
||||
},
|
||||
getGrowTime: function(ip, hack, int) {
|
||||
getGrowTime: function(ip) {
|
||||
updateDynamicRam("getGrowTime", getRamCost("getGrowTime"));
|
||||
const server = safeGetServer(ip, "getGrowTime");
|
||||
if (failOnHacknetServer(server, "getGrowTime")) { return Infinity; }
|
||||
|
||||
return calculateGrowTime(server, Player); // Returns seconds
|
||||
},
|
||||
getWeakenTime: function(ip, hack, int) {
|
||||
getWeakenTime: function(ip) {
|
||||
updateDynamicRam("getWeakenTime", getRamCost("getWeakenTime"));
|
||||
const server = safeGetServer(ip, "getWeakenTime");
|
||||
if (failOnHacknetServer(server, "getWeakenTime")) { return Infinity; }
|
||||
@@ -2570,7 +2559,7 @@ function NetscriptFunctions(workerScript) {
|
||||
const popupId = `prompt-popup-${txt.slice(0, 20)}`;
|
||||
const textElement = createElement("p", { innerHTML: txt });
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
return new Promise(function(resolve) {
|
||||
const yesBtn = createElement("button", {
|
||||
class: "popup-box-button",
|
||||
innerText: "Yes",
|
||||
@@ -2598,7 +2587,7 @@ function NetscriptFunctions(workerScript) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
var s = safeGetServer(ip, "wget");
|
||||
return new Promise(function(resolve, reject) {
|
||||
return new Promise(function(resolve) {
|
||||
$.get(url, function(data) {
|
||||
let res;
|
||||
if (isScriptFilename(target)) {
|
||||
|
||||
Reference in New Issue
Block a user