From 1cc0ff22c1a7371299f926b0d863de3ab8bb7a4b Mon Sep 17 00:00:00 2001 From: Alexander T Date: Fri, 14 Jun 2019 10:25:02 +0300 Subject: [PATCH] no-eval --- .eslintrc | 2 +- src/harness/evaluator.ts | 4 ++-- src/harness/fourslash.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.eslintrc b/.eslintrc index bef1efdd3e6..4ae35570764 100644 --- a/.eslintrc +++ b/.eslintrc @@ -83,7 +83,7 @@ "no-duplicate-case": "error", "no-duplicate-imports": "error", "no-empty": "error", - "no-eval": "off", + "no-eval": "error", "no-extra-bind": "error", "no-fallthrough": "off", "no-invalid-this": "off", diff --git a/src/harness/evaluator.ts b/src/harness/evaluator.ts index a22bdb958bc..32314d1dbd8 100644 --- a/src/harness/evaluator.ts +++ b/src/harness/evaluator.ts @@ -56,7 +56,7 @@ namespace evaluator { } const evaluateText = `(function (module, exports, require, __dirname, __filename, ${globalNames.join(", ")}) { ${output.text} })`; - // tslint:disable-next-line:no-eval + // eslint-disable-next-line no-eval const evaluateThunk = eval(evaluateText) as (module: any, exports: any, require: (id: string) => any, dirname: string, filename: string, ...globalArgs: any[]) => void; const module: { exports: any; } = { exports: {} }; evaluateThunk.call(globals, module, module.exports, noRequire, vpath.dirname(output.file), output.file, FakeSymbol, ...globalArgs); @@ -66,4 +66,4 @@ namespace evaluator { export function evaluateTypeScript(sourceText: string, options?: ts.CompilerOptions, globals?: Record) { return evaluate(compile(sourceText, options), globals); } -} \ No newline at end of file +} diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 345709ca550..bac70e8b7a0 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -3193,7 +3193,7 @@ ${code} const debug = new FourSlashInterface.Debug(state); const format = new FourSlashInterface.Format(state); const cancellation = new FourSlashInterface.Cancellation(state); - // tslint:disable-next-line:no-eval + // eslint-disable-next-line no-eval const f = eval(wrappedCode); f(test, goTo, plugins, verify, edit, debug, format, cancellation, FourSlashInterface.Classification, FourSlashInterface.Completion, verifyOperationIsCancelled); }