diff options
Diffstat (limited to 'node_modules/tslint/lib/rules/awaitPromiseRule.js')
-rw-r--r-- | node_modules/tslint/lib/rules/awaitPromiseRule.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/node_modules/tslint/lib/rules/awaitPromiseRule.js b/node_modules/tslint/lib/rules/awaitPromiseRule.js index ba26774f6..69855f49f 100644 --- a/node_modules/tslint/lib/rules/awaitPromiseRule.js +++ b/node_modules/tslint/lib/rules/awaitPromiseRule.js @@ -20,15 +20,14 @@ var tslib_1 = require("tslib"); var tsutils_1 = require("tsutils"); var ts = require("typescript"); var Lint = require("../index"); -var Rule = (function (_super) { +var Rule = /** @class */ (function (_super) { tslib_1.__extends(Rule, _super); function Rule() { return _super !== null && _super.apply(this, arguments) || this; } Rule.prototype.applyWithProgram = function (sourceFile, program) { var promiseTypes = new Set(["Promise"].concat(this.ruleArguments)); - var tc = program.getTypeChecker(); - return this.applyWithFunction(sourceFile, function (ctx) { return walk(ctx, tc, promiseTypes); }); + return this.applyWithFunction(sourceFile, walk, promiseTypes, program.getTypeChecker()); }; /* tslint:disable:object-literal-sort-keys */ Rule.metadata = { @@ -52,7 +51,8 @@ var Rule = (function (_super) { return Rule; }(Lint.Rules.TypedRule)); exports.Rule = Rule; -function walk(ctx, tc, promiseTypes) { +function walk(ctx, tc) { + var promiseTypes = ctx.options; return ts.forEachChild(ctx.sourceFile, cb); function cb(node) { if (tsutils_1.isAwaitExpression(node) && !couldBePromise(tc.getTypeAtLocation(node.expression))) { |