Trailing whitespace and files not ending with \n are now illegal

This commit is contained in:
BB 2022-03-06 05:34:04 +01:00
parent 570b8caf78
commit 2f4d879c16
14 changed files with 18 additions and 18 deletions

@ -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"],

@ -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}")`);

@ -16,4 +16,4 @@ for (const actionName of actionNames){
GeneralActions[actionName] = new Action({
name: actionName,
});
}
}

@ -74,7 +74,7 @@ for (var i = 0; i < multKeys.length; ++i) {
if (mult && mult !== 1) {
mult = formatNumber(mult, 3);
switch(multKeys[i]) {
}
}
}

@ -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: {

@ -559,7 +559,7 @@ export const FactionInfos: IMap<FactionInfo> = {
{" `..` "}<br /><br />
Many cultures predict an end to humanity in the near future, a final
Armageddon that will end the world; but we disagree.
<br /><br />Note that for this faction, reputation can
<br /><br />Note that for this faction, reputation can
only be gained by charging Stanek's gift.</>,
[],
false,

@ -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 "";
}

@ -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 */

@ -260,7 +260,7 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
token: "ns",
foreground: "FFB86C",
fontStyle: "italic",
},
{
token: "netscriptfunction",

@ -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];

@ -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");

@ -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`,

@ -288,4 +288,4 @@ function LogWindow(props: IProps): React.ReactElement {
</Paper>
</Draggable>
);
}
}

@ -75,4 +75,4 @@ export function subsetOf<Type, Key extends keyof Type, Value>(options: Value[]):
}
obj[key] = validValues as unknown as Type[Key];
};
}
}