diff options
Diffstat (limited to 'node_modules/tslint/lib/language/rule')
5 files changed, 13 insertions, 9 deletions
diff --git a/node_modules/tslint/lib/language/rule/abstractRule.d.ts b/node_modules/tslint/lib/language/rule/abstractRule.d.ts index 8a2362b5c..a5c2b82ac 100644 --- a/node_modules/tslint/lib/language/rule/abstractRule.d.ts +++ b/node_modules/tslint/lib/language/rule/abstractRule.d.ts @@ -17,6 +17,9 @@ import * as ts from "typescript"; import { IWalker, WalkContext } from "../walker"; import { IOptions, IRule, IRuleMetadata, RuleFailure, RuleSeverity } from "./rule"; +export declare type NoInfer<T> = T & { + [K in keyof T]: T[K]; +}; export declare abstract class AbstractRule implements IRule { private options; static metadata: IRuleMetadata; @@ -29,7 +32,8 @@ export declare abstract class AbstractRule implements IRule { applyWithWalker(walker: IWalker): RuleFailure[]; isEnabled(): boolean; protected applyWithFunction(sourceFile: ts.SourceFile, walkFn: (ctx: WalkContext<void>) => void): RuleFailure[]; - protected applyWithFunction<T, U extends T>(sourceFile: ts.SourceFile, walkFn: (ctx: WalkContext<T>) => void, options: U): RuleFailure[]; + protected applyWithFunction<T>(sourceFile: ts.SourceFile, walkFn: (ctx: WalkContext<T>) => void, options: NoInfer<T>): RuleFailure[]; + protected applyWithFunction<T, U>(sourceFile: ts.SourceFile, walkFn: (ctx: WalkContext<T>, programOrChecker: U) => void, options: NoInfer<T>, checker: NoInfer<U>): RuleFailure[]; /** * @deprecated * Failures will be filtered based on `tslint:disable` comments by tslint. diff --git a/node_modules/tslint/lib/language/rule/abstractRule.js b/node_modules/tslint/lib/language/rule/abstractRule.js index 52f4c8f55..879ac31b8 100644 --- a/node_modules/tslint/lib/language/rule/abstractRule.js +++ b/node_modules/tslint/lib/language/rule/abstractRule.js @@ -17,7 +17,7 @@ */ Object.defineProperty(exports, "__esModule", { value: true }); var walker_1 = require("../walker"); -var AbstractRule = (function () { +var AbstractRule = /** @class */ (function () { function AbstractRule(options) { this.options = options; this.ruleName = options.ruleName; @@ -34,9 +34,9 @@ var AbstractRule = (function () { AbstractRule.prototype.isEnabled = function () { return this.ruleSeverity !== "off"; }; - AbstractRule.prototype.applyWithFunction = function (sourceFile, walkFn, options) { + AbstractRule.prototype.applyWithFunction = function (sourceFile, walkFn, options, programOrChecker) { var ctx = new walker_1.WalkContext(sourceFile, this.ruleName, options); - walkFn(ctx); + walkFn(ctx, programOrChecker); return ctx.failures; }; /** diff --git a/node_modules/tslint/lib/language/rule/optionallyTypedRule.js b/node_modules/tslint/lib/language/rule/optionallyTypedRule.js index 1914eda40..1aefda55e 100644 --- a/node_modules/tslint/lib/language/rule/optionallyTypedRule.js +++ b/node_modules/tslint/lib/language/rule/optionallyTypedRule.js @@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var abstractRule_1 = require("./abstractRule"); -var OptionallyTypedRule = (function (_super) { +var OptionallyTypedRule = /** @class */ (function (_super) { tslib_1.__extends(OptionallyTypedRule, _super); function OptionallyTypedRule() { return _super !== null && _super.apply(this, arguments) || this; diff --git a/node_modules/tslint/lib/language/rule/rule.js b/node_modules/tslint/lib/language/rule/rule.js index 98291f25a..6feae5e96 100644 --- a/node_modules/tslint/lib/language/rule/rule.js +++ b/node_modules/tslint/lib/language/rule/rule.js @@ -21,7 +21,7 @@ function isTypedRule(rule) { return "applyWithProgram" in rule; } exports.isTypedRule = isTypedRule; -var Replacement = (function () { +var Replacement = /** @class */ (function () { function Replacement(start, length, text) { this.start = start; this.length = length; @@ -72,7 +72,7 @@ var Replacement = (function () { return Replacement; }()); exports.Replacement = Replacement; -var RuleFailurePosition = (function () { +var RuleFailurePosition = /** @class */ (function () { function RuleFailurePosition(position, lineAndCharacter) { this.position = position; this.lineAndCharacter = lineAndCharacter; @@ -100,7 +100,7 @@ var RuleFailurePosition = (function () { return RuleFailurePosition; }()); exports.RuleFailurePosition = RuleFailurePosition; -var RuleFailure = (function () { +var RuleFailure = /** @class */ (function () { function RuleFailure(sourceFile, start, end, failure, ruleName, fix) { this.sourceFile = sourceFile; this.failure = failure; diff --git a/node_modules/tslint/lib/language/rule/typedRule.js b/node_modules/tslint/lib/language/rule/typedRule.js index e713dcdbb..83873d49f 100644 --- a/node_modules/tslint/lib/language/rule/typedRule.js +++ b/node_modules/tslint/lib/language/rule/typedRule.js @@ -19,7 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var error_1 = require("../../error"); var abstractRule_1 = require("./abstractRule"); -var TypedRule = (function (_super) { +var TypedRule = /** @class */ (function (_super) { tslib_1.__extends(TypedRule, _super); function TypedRule() { return _super !== null && _super.apply(this, arguments) || this; |