diff --git a/.eslintrc b/.eslintrc index ca3ca2a7da5..03beb285783 100644 --- a/.eslintrc +++ b/.eslintrc @@ -88,7 +88,7 @@ "no-fallthrough": "off", "no-invalid-this": "off", "no-multiple-empty-lines": "off", - "no-new-func": "off", + "no-new-func": "error", "no-new-wrappers": "error", "no-redeclare": "off", "no-return-await": "error", diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index bac70e8b7a0..80fb27508d9 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -600,7 +600,7 @@ namespace FourSlash { throw new Error("Expected exactly one output from emit of " + this.activeFile.fileName); } - const evaluation = new Function(`${emit.outputFiles[0].text};\r\nreturn (${expr});`)(); // tslint:disable-line:function-constructor + const evaluation = new Function(`${emit.outputFiles[0].text};\r\nreturn (${expr});`)(); // eslint-disable-line no-new-func if (evaluation !== value) { this.raiseError(`Expected evaluation of expression "${expr}" to equal "${value}", but got "${evaluation}"`); } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index f03103d0239..029ff5c593d 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -28,7 +28,7 @@ var assert: typeof _chai.assert = _chai.assert; }; } -var global: NodeJS.Global = Function("return this").call(undefined); // tslint:disable-line:function-constructor +var global: NodeJS.Global = Function("return this").call(undefined); // eslint-disable-line no-new-func declare var window: {}; declare var XMLHttpRequest: new() => XMLHttpRequest;