From 2f4d879c16bdef6e12b6df055fa3aa9292b2e3f0 Mon Sep 17 00:00:00 2001 From: BB Date: Sun, 6 Mar 2022 05:34:04 +0100 Subject: [PATCH] Trailing whitespace and files not ending with \n are now illegal --- .eslintrc.js | 4 ++-- electron/api-server.js | 4 ++-- src/Bladeburner/GeneralActions.tsx | 2 +- src/Bladeburner/ui/SkillPage.tsx | 2 +- src/Corporation/Industry.ts | 2 +- src/Faction/FactionInfo.tsx | 2 +- src/NetscriptFunctions.ts | 2 +- src/ScriptEditor/NetscriptDefinitions.d.ts | 4 ++-- src/ScriptEditor/ui/themes.ts | 2 +- src/Terminal/commands/ps.ts | 2 +- src/Terminal/ui/TerminalInput.tsx | 4 ++-- src/data/codingcontracttypes.ts | 2 +- src/ui/React/LogBoxManager.tsx | 2 +- src/utils/Validator.ts | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5635abd7c..0f285e40e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -43,7 +43,7 @@ module.exports = { curly: ["off"], "default-case": ["off"], "dot-notation": ["off"], - "eol-last": ["off"], + "eol-last": ["error"], eqeqeq: ["off"], "for-direction": ["error"], "func-call-spacing": ["off"], @@ -236,7 +236,7 @@ module.exports = { "no-ternary": ["off"], "no-this-before-super": ["off"], "no-throw-literal": ["error"], - "no-trailing-spaces": ["off"], + "no-trailing-spaces": ["error"], "no-undef": ["off"], "no-undef-init": ["error"], "no-undefined": ["off"], diff --git a/electron/api-server.js b/electron/api-server.js index 971922b71..54b72108a 100644 --- a/electron/api-server.js +++ b/electron/api-server.js @@ -26,7 +26,7 @@ async function initialize(win) { } else { log.log('Invalid authentication token'); res.writeHead(401); - + res.end(JSON.stringify({ success: false, msg: 'Invalid authentication token' @@ -71,7 +71,7 @@ async function initialize(win) { result = await window.webContents.executeJavaScript(`document.saveFile("${data.filename}", "${data.code}")`); break; - + // Delete files case "DELETE": result = await window.webContents.executeJavaScript(`document.deleteFile("${data.filename}")`); diff --git a/src/Bladeburner/GeneralActions.tsx b/src/Bladeburner/GeneralActions.tsx index 37a9bca1d..1b11a10d3 100644 --- a/src/Bladeburner/GeneralActions.tsx +++ b/src/Bladeburner/GeneralActions.tsx @@ -16,4 +16,4 @@ for (const actionName of actionNames){ GeneralActions[actionName] = new Action({ name: actionName, }); -} \ No newline at end of file +} diff --git a/src/Bladeburner/ui/SkillPage.tsx b/src/Bladeburner/ui/SkillPage.tsx index 59e95c4c9..e9c6986a6 100644 --- a/src/Bladeburner/ui/SkillPage.tsx +++ b/src/Bladeburner/ui/SkillPage.tsx @@ -74,7 +74,7 @@ for (var i = 0; i < multKeys.length; ++i) { if (mult && mult !== 1) { mult = formatNumber(mult, 3); switch(multKeys[i]) { - + } } } diff --git a/src/Corporation/Industry.ts b/src/Corporation/Industry.ts index ddf0ec3fe..2161c4b55 100644 --- a/src/Corporation/Industry.ts +++ b/src/Corporation/Industry.ts @@ -1286,7 +1286,7 @@ export class Industry implements IIndustry { this.awareness = Math.min(awareness, Number.MAX_VALUE); const popularity = (this.popularity + (1 * advMult)) * ((1 + getRandomInt(1, 3) / 100) * advMult); - this.popularity = Math.min(popularity, Number.MAX_VALUE); + this.popularity = Math.min(popularity, Number.MAX_VALUE); break; } default: { diff --git a/src/Faction/FactionInfo.tsx b/src/Faction/FactionInfo.tsx index d8f687804..440898727 100644 --- a/src/Faction/FactionInfo.tsx +++ b/src/Faction/FactionInfo.tsx @@ -559,7 +559,7 @@ export const FactionInfos: IMap = { {" `..` "}

Many cultures predict an end to humanity in the near future, a final Armageddon that will end the world; but we disagree. -

Note that for this faction, reputation can +

Note that for this faction, reputation can only be gained by charging Stanek's gift., [], false, diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 2a6efef8e..764a7bde7 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -1655,7 +1655,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { }else{ workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}' must be a positive power of 2`); } - + return ""; } diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index c2e582f53..0d1e16ece 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -905,9 +905,9 @@ export interface GangMemberInfo { /** Name of the gang member */ name: string; /** Currently assigned task */ - task: string; + task: string; earnedRespect: number; - + /** Hack skill level */ hack: number; /** Strength skill level */ diff --git a/src/ScriptEditor/ui/themes.ts b/src/ScriptEditor/ui/themes.ts index 943b94ccb..df6463e20 100644 --- a/src/ScriptEditor/ui/themes.ts +++ b/src/ScriptEditor/ui/themes.ts @@ -260,7 +260,7 @@ export async function loadThemes(monaco: { editor: any }): Promise { token: "ns", foreground: "FFB86C", fontStyle: "italic", - + }, { token: "netscriptfunction", diff --git a/src/Terminal/commands/ps.ts b/src/Terminal/commands/ps.ts index 695d9a71d..6edaac34c 100644 --- a/src/Terminal/commands/ps.ts +++ b/src/Terminal/commands/ps.ts @@ -36,7 +36,7 @@ export function ps( } terminal.print(res); } - } + } if(args.length === 0){ for (let i = 0; i < server.runningScripts.length; i++) { const rsObj = server.runningScripts[i]; diff --git a/src/Terminal/ui/TerminalInput.tsx b/src/Terminal/ui/TerminalInput.tsx index bf9e1f400..318a77765 100644 --- a/src/Terminal/ui/TerminalInput.tsx +++ b/src/Terminal/ui/TerminalInput.tsx @@ -356,12 +356,12 @@ export function TerminalInput({ terminal, router, player }: IProps): React.React event.preventDefault(); modifyInput("deletewordbefore"); } - + if (event.keyCode === KEY.D && event.altKey) { event.preventDefault(); modifyInput("deletewordafter"); } - + if (event.keyCode === KEY.U && event.ctrlKey) { event.preventDefault(); modifyInput("clearbefore"); diff --git a/src/data/codingcontracttypes.ts b/src/data/codingcontracttypes.ts index 599179a7a..9c9622ede 100644 --- a/src/data/codingcontracttypes.ts +++ b/src/data/codingcontracttypes.ts @@ -921,7 +921,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ "The provided answer should be an array of strings containing the valid expressions.", "The data provided by this problem is an array with two elements. The first element", "is the string of digits, while the second element is the target number:\n\n", - `["${digits}", ${target}]\n\n`, + `["${digits}", ${target}]\n\n`, "NOTE: The order of evaluation expects script operator precedence", "NOTE: Numbers in the expression cannot have leading 0's. In other words,", `"1+01" is not a valid expression`, diff --git a/src/ui/React/LogBoxManager.tsx b/src/ui/React/LogBoxManager.tsx index 635877164..86d8f6895 100644 --- a/src/ui/React/LogBoxManager.tsx +++ b/src/ui/React/LogBoxManager.tsx @@ -288,4 +288,4 @@ function LogWindow(props: IProps): React.ReactElement { ); -} \ No newline at end of file +} diff --git a/src/utils/Validator.ts b/src/utils/Validator.ts index 21daba59e..ab62d653e 100644 --- a/src/utils/Validator.ts +++ b/src/utils/Validator.ts @@ -75,4 +75,4 @@ export function subsetOf(options: Value[]): } obj[key] = validValues as unknown as Type[Key]; }; -} \ No newline at end of file +}