Skip to content

Commit 1f10e74

Browse files
committed
Enable no-eval rule
1 parent 32b44ac commit 1f10e74

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

src/harness/evaluator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ namespace evaluator {
5656
}
5757

5858
const evaluateText = `(function (module, exports, require, __dirname, __filename, ${globalNames.join(", ")}) { ${output.text} })`;
59+
// tslint:disable-next-line:no-eval
5960
const evaluateThunk = eval(evaluateText) as (module: any, exports: any, require: (id: string) => any, dirname: string, filename: string, ...globalArgs: any[]) => void;
6061
const module: { exports: any; } = { exports: {} };
6162
evaluateThunk.call(globals, module, module.exports, noRequire, vpath.dirname(output.file), output.file, FakeSymbol, ...globalArgs);

src/harness/fourslash.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3159,6 +3159,7 @@ ${code}
31593159
const debug = new FourSlashInterface.Debug(state);
31603160
const format = new FourSlashInterface.Format(state);
31613161
const cancellation = new FourSlashInterface.Cancellation(state);
3162+
// tslint:disable-next-line:no-eval
31623163
const f = eval(wrappedCode);
31633164
f(test, goTo, plugins, verify, edit, debug, format, cancellation, FourSlashInterface.Classification, FourSlashInterface.Completion, verifyOperationIsCancelled);
31643165
}

src/harness/harness.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ namespace Utils {
7777
const environment = getExecutionEnvironment();
7878
switch (environment) {
7979
case ExecutionEnvironment.Browser:
80+
// tslint:disable-next-line:no-eval
8081
eval(fileContents);
8182
break;
8283
case ExecutionEnvironment.Node:

tslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
],
3535
"no-bom": true,
3636
"no-double-space": true,
37+
"no-eval": true,
3738
"no-in-operator": true,
3839
"no-increment-decrement": true,
3940
"no-inferrable-types": true,
@@ -100,7 +101,6 @@
100101
"no-console": false,
101102
"no-debugger": false,
102103
"no-empty-interface": false,
103-
"no-eval": false,
104104
"no-object-literal-type-assertion": false,
105105
"no-shadowed-variable": false,
106106
"no-submodule-imports": false,

0 commit comments

Comments
 (0)