tidy up eslint.js

This commit is contained in:
Olivier Gagnon
2022-07-19 12:19:32 -04:00
parent 2f029e94b4
commit c977a9def7
9 changed files with 12 additions and 33 deletions

View File

@ -7,7 +7,7 @@ module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
parser: "@typescript-eslint/parser",
parserOptions: {
@ -21,29 +21,7 @@ module.exports = {
plugins: ["@typescript-eslint"],
extends: ["plugin:@typescript-eslint/recommended"],
rules: {
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@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",
},
};

View File

@ -77,7 +77,7 @@ interface IBNMultTableProps {
const BNMultTable = (props: IBNMultTableProps): React.ReactElement => {
const rowsArray = Object.entries(props.rowData)
.filter(([key, _value]) => props.mults[key] !== defaultMultipliers[key])
.filter(([key]) => props.mults[key] !== defaultMultipliers[key])
.map(([key, value]) => (
<StatsRow
key={uniqueId()}

View File

@ -138,6 +138,9 @@ export function NetscriptStanek(
!player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)
) {
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

View File

@ -575,7 +575,7 @@ export function getNextCompanyPosition(
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) {
this.finishWork(true);
}

View File

@ -54,7 +54,7 @@ export function SleeveAugmentationsModal(props: IProps): React.ReactElement {
canPurchase={(player, aug) => {
return player.money > aug.baseCost;
}}
purchaseAugmentation={(player, aug, _showModal) => {
purchaseAugmentation={(player, aug) => {
props.sleeve.tryBuyAugmentation(player, aug);
rerender();
}}

View File

@ -240,7 +240,7 @@ const canDo: {
[CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
"Workout at Gym": (player: IPlayer, sleeve: Sleeve) =>
[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,
Synchronize: (player: IPlayer, sleeve: Sleeve) => sleeve.sync < 100,
};

View File

@ -1424,8 +1424,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
if (ans == "[]") {
//Helper function to get neighbourhood of a vertex
function neighbourhood(vertex: number): number[] {
const adjLeft = data[1].filter(([a, _]) => a == vertex).map(([_, b]) => b);
const adjRight = data[1].filter(([_, b]) => b == vertex).map(([a, _]) => a);
const adjLeft = data[1].filter(([a]) => a == vertex).map(([, b]) => b);
const adjRight = data[1].filter(([, b]) => b == vertex).map(([a]) => a);
return adjLeft.concat(adjRight);
}

View File

@ -14,7 +14,6 @@ import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos";
import { workerScripts } from "../../Netscript/WorkerScripts";
import { startWorkerScript } from "../../NetscriptWorker";
import { GetServer } from "../../Server/AllServers";
import { Theme } from "@mui/material";
import { findRunningScript } from "../../Script/ScriptHelpers";
import { Player } from "../../Player";
import { debounce } from "lodash";
@ -97,7 +96,7 @@ interface IProps {
onClose: () => void;
}
const useStyles = makeStyles((_theme: Theme) =>
const useStyles = makeStyles(() =>
createStyles({
logs: {
overflowY: "scroll",

View File

@ -128,9 +128,8 @@ function PromptMenuSelect({ prompt, resolve }: IContentProps): React.ReactElemen
};
const getItems = (choices: string[]): React.ReactElement[] => {
const content = [];
const content: React.ReactElement[] = [];
for (const i of choices) {
// @ts-ignore
content.push(
<MenuItem key={i} value={i}>
{i}