mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
tidy up eslint.js
This commit is contained in:
24
.eslintrc.js
24
.eslintrc.js
@@ -7,7 +7,7 @@ module.exports = {
|
|||||||
extends: [
|
extends: [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
|
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||||
],
|
],
|
||||||
parser: "@typescript-eslint/parser",
|
parser: "@typescript-eslint/parser",
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
@@ -21,29 +21,7 @@ module.exports = {
|
|||||||
plugins: ["@typescript-eslint"],
|
plugins: ["@typescript-eslint"],
|
||||||
extends: ["plugin:@typescript-eslint/recommended"],
|
extends: ["plugin:@typescript-eslint/recommended"],
|
||||||
rules: {
|
rules: {
|
||||||
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
||||||
"@typescript-eslint/ban-ts-comment": "off",
|
"@typescript-eslint/ban-ts-comment": "off",
|
||||||
"@typescript-eslint/explicit-function-return-type": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
allowExpressions: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
// "no-constant-condition": [
|
|
||||||
// "error",
|
|
||||||
// {
|
|
||||||
// checkLoops: false,
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
"no-empty": [
|
|
||||||
"off",
|
|
||||||
{
|
|
||||||
allowEmptyCatch: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"no-inner-declarations": ["off", "both"],
|
|
||||||
"no-prototype-builtins": ["off"],
|
|
||||||
"no-useless-escape": ["off"],
|
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ interface IBNMultTableProps {
|
|||||||
|
|
||||||
const BNMultTable = (props: IBNMultTableProps): React.ReactElement => {
|
const BNMultTable = (props: IBNMultTableProps): React.ReactElement => {
|
||||||
const rowsArray = Object.entries(props.rowData)
|
const rowsArray = Object.entries(props.rowData)
|
||||||
.filter(([key, _value]) => props.mults[key] !== defaultMultipliers[key])
|
.filter(([key]) => props.mults[key] !== defaultMultipliers[key])
|
||||||
.map(([key, value]) => (
|
.map(([key, value]) => (
|
||||||
<StatsRow
|
<StatsRow
|
||||||
key={uniqueId()}
|
key={uniqueId()}
|
||||||
|
|||||||
@@ -138,6 +138,9 @@ export function NetscriptStanek(
|
|||||||
!player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)
|
!player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)
|
||||||
) {
|
) {
|
||||||
applyAugmentation({ name: AugmentationNames.StaneksGift1, level: 1 });
|
applyAugmentation({ name: AugmentationNames.StaneksGift1, level: 1 });
|
||||||
|
_ctx.log(
|
||||||
|
() => `'${FactionNames.ChurchOfTheMachineGod}' joined and '${AugmentationNames.StaneksGift1}' installed.`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Return true iff the player is in CotMG and has the first Stanek aug installed
|
//Return true iff the player is in CotMG and has the first Stanek aug installed
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ export function getNextCompanyPosition(
|
|||||||
return entryPosType;
|
return entryPosType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function quitJob(this: IPlayer, company: string, _sing = false): void {
|
export function quitJob(this: IPlayer, company: string): void {
|
||||||
if (isCompanyWork(this.currentWork) && this.currentWork.companyName === company) {
|
if (isCompanyWork(this.currentWork) && this.currentWork.companyName === company) {
|
||||||
this.finishWork(true);
|
this.finishWork(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export function SleeveAugmentationsModal(props: IProps): React.ReactElement {
|
|||||||
canPurchase={(player, aug) => {
|
canPurchase={(player, aug) => {
|
||||||
return player.money > aug.baseCost;
|
return player.money > aug.baseCost;
|
||||||
}}
|
}}
|
||||||
purchaseAugmentation={(player, aug, _showModal) => {
|
purchaseAugmentation={(player, aug) => {
|
||||||
props.sleeve.tryBuyAugmentation(player, aug);
|
props.sleeve.tryBuyAugmentation(player, aug);
|
||||||
rerender();
|
rerender();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ const canDo: {
|
|||||||
[CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
|
[CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
|
||||||
"Workout at Gym": (player: IPlayer, sleeve: Sleeve) =>
|
"Workout at Gym": (player: IPlayer, sleeve: Sleeve) =>
|
||||||
[CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
|
[CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
|
||||||
"Perform Bladeburner Actions": (player: IPlayer, _: Sleeve) => player.inBladeburner(),
|
"Perform Bladeburner Actions": (player: IPlayer) => player.inBladeburner(),
|
||||||
"Shock Recovery": (player: IPlayer, sleeve: Sleeve) => sleeve.shock < 100,
|
"Shock Recovery": (player: IPlayer, sleeve: Sleeve) => sleeve.shock < 100,
|
||||||
Synchronize: (player: IPlayer, sleeve: Sleeve) => sleeve.sync < 100,
|
Synchronize: (player: IPlayer, sleeve: Sleeve) => sleeve.sync < 100,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1424,8 +1424,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
|||||||
if (ans == "[]") {
|
if (ans == "[]") {
|
||||||
//Helper function to get neighbourhood of a vertex
|
//Helper function to get neighbourhood of a vertex
|
||||||
function neighbourhood(vertex: number): number[] {
|
function neighbourhood(vertex: number): number[] {
|
||||||
const adjLeft = data[1].filter(([a, _]) => a == vertex).map(([_, b]) => b);
|
const adjLeft = data[1].filter(([a]) => a == vertex).map(([, b]) => b);
|
||||||
const adjRight = data[1].filter(([_, b]) => b == vertex).map(([a, _]) => a);
|
const adjRight = data[1].filter(([, b]) => b == vertex).map(([a]) => a);
|
||||||
return adjLeft.concat(adjRight);
|
return adjLeft.concat(adjRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
|
|||||||
import { workerScripts } from "../../Netscript/WorkerScripts";
|
import { workerScripts } from "../../Netscript/WorkerScripts";
|
||||||
import { startWorkerScript } from "../../NetscriptWorker";
|
import { startWorkerScript } from "../../NetscriptWorker";
|
||||||
import { GetServer } from "../../Server/AllServers";
|
import { GetServer } from "../../Server/AllServers";
|
||||||
import { Theme } from "@mui/material";
|
|
||||||
import { findRunningScript } from "../../Script/ScriptHelpers";
|
import { findRunningScript } from "../../Script/ScriptHelpers";
|
||||||
import { Player } from "../../Player";
|
import { Player } from "../../Player";
|
||||||
import { debounce } from "lodash";
|
import { debounce } from "lodash";
|
||||||
@@ -97,7 +96,7 @@ interface IProps {
|
|||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const useStyles = makeStyles((_theme: Theme) =>
|
const useStyles = makeStyles(() =>
|
||||||
createStyles({
|
createStyles({
|
||||||
logs: {
|
logs: {
|
||||||
overflowY: "scroll",
|
overflowY: "scroll",
|
||||||
|
|||||||
@@ -128,9 +128,8 @@ function PromptMenuSelect({ prompt, resolve }: IContentProps): React.ReactElemen
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getItems = (choices: string[]): React.ReactElement[] => {
|
const getItems = (choices: string[]): React.ReactElement[] => {
|
||||||
const content = [];
|
const content: React.ReactElement[] = [];
|
||||||
for (const i of choices) {
|
for (const i of choices) {
|
||||||
// @ts-ignore
|
|
||||||
content.push(
|
content.push(
|
||||||
<MenuItem key={i} value={i}>
|
<MenuItem key={i} value={i}>
|
||||||
{i}
|
{i}
|
||||||
|
|||||||
Reference in New Issue
Block a user