mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
no-eval
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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<string, any>) {
|
||||
return evaluate(compile(sourceText, options), globals);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user