4 * Copyright 2013 Palantir Technologies, Inc.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 Object.defineProperty(exports, "__esModule", { value: true });
19 var walker_1 = require("../walker");
20 var AbstractRule = /** @class */ (function () {
21 function AbstractRule(options) {
22 this.options = options;
23 this.ruleName = options.ruleName;
24 this.ruleArguments = options.ruleArguments;
25 this.ruleSeverity = options.ruleSeverity;
27 AbstractRule.prototype.getOptions = function () {
30 AbstractRule.prototype.applyWithWalker = function (walker) {
31 walker.walk(walker.getSourceFile());
32 return walker.getFailures();
34 AbstractRule.prototype.isEnabled = function () {
35 return this.ruleSeverity !== "off";
37 AbstractRule.prototype.applyWithFunction = function (sourceFile, walkFn, options, programOrChecker) {
38 var ctx = new walker_1.WalkContext(sourceFile, this.ruleName, options);
39 walkFn(ctx, programOrChecker);
44 * Failures will be filtered based on `tslint:disable` comments by tslint.
45 * This method now does nothing.
47 AbstractRule.prototype.filterFailures = function (failures) {
52 exports.AbstractRule = AbstractRule;