Remove tslint

This commit is contained in:
Simon Warta
2020-02-19 09:37:05 +01:00
parent 74db239571
commit 4b7a060a4b
17 changed files with 11 additions and 110 deletions
-1
View File
@@ -22,7 +22,6 @@ export function wrapInAsyncFunction(code: string): string {
}
// Remove var, let, const from variable declarations to make them available in context
// tslint:disable-next-line:no-object-mutation
ast.program.body[0].expression.callee.body.body = body.map((node: any) => {
if (node.type === "VariableDeclaration") {
return {
+2 -2
View File
@@ -1,11 +1,11 @@
import { ArgumentParser } from "argparse";
// tslint:disable-next-line:no-submodule-imports
import colors = require("colors/safe");
import * as fs from "fs";
import { join } from "path";
import { TsRepl } from "./tsrepl";
import colors = require("colors/safe");
export function main(originalArgs: readonly string[]): void {
const parser = new ArgumentParser({ description: "The CosmWasm REPL" });
parser.addArgument("--version", {
-1
View File
@@ -52,7 +52,6 @@ describe("Helpers", () => {
expect(executeJavaScript("module.exports.fooTest = 'bar'", "myfile.js", context)).toEqual("bar");
expect(executeJavaScript("module.exports.fooTest", "myfile.js", context)).toEqual("bar");
// roll back change to module.exports
// tslint:disable-next-line:no-object-mutation
module.exports.fooTest = undefined;
});
-9
View File
@@ -19,7 +19,6 @@ export class TsRepl {
private readonly evalData = { input: "", output: "" };
private readonly resetToZero: () => void; // Bookmark to empty TS input
private readonly initialTypeScript: string;
// tslint:disable-next-line:readonly-keyword
private context: Context | undefined;
public constructor(
@@ -69,7 +68,6 @@ export class TsRepl {
// to exist in `Object.defineProperty(exports, "__esModule", { value: true });`
const unsafeReplContext = repl.context as any;
if (!unsafeReplContext.exports) {
// tslint:disable-next-line:no-object-mutation
unsafeReplContext.exports = unsafeReplContext.module.exports;
}
@@ -85,10 +83,8 @@ export class TsRepl {
// However, this does not include the installation path of @cosmwasm/cli because
// REPL does not inherit module paths from the current process. Thus we override
// the repl paths with the current process' paths
// tslint:disable-next-line:no-object-mutation
unsafeReplContext.module.paths = module.paths;
// tslint:disable-next-line:no-object-mutation
this.context = createContext(repl.context);
const reset = async (): Promise<void> => {
@@ -153,7 +149,6 @@ export class TsRepl {
if (isAutocompletionRequest) {
undo();
} else {
// tslint:disable-next-line:no-object-mutation
this.evalData.output = output;
}
@@ -220,17 +215,13 @@ export class TsRepl {
// Handle ASI issues with TypeScript re-evaluation.
if (oldInput.charAt(oldInput.length - 1) === "\n" && /^\s*[[(`]/.test(input) && !/;\s*$/.test(oldInput)) {
// tslint:disable-next-line:no-object-mutation
this.evalData.input = `${this.evalData.input.slice(0, -1)};\n`;
}
// tslint:disable-next-line:no-object-mutation
this.evalData.input += input;
const undoFunction = (): void => {
// tslint:disable-next-line:no-object-mutation
this.evalData.input = oldInput;
// tslint:disable-next-line:no-object-mutation
this.evalData.output = oldOutput;
};