|
1 | | -var __extends = |
2 | | - (this && this.__extends) || |
3 | | - function(d, b) { |
4 | | - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; |
5 | | - function __() { |
6 | | - this.constructor = d; |
| 1 | +const Lint = require('tslint'); |
| 2 | + |
| 3 | +class Rule extends Lint.Rules.AbstractRule { |
| 4 | + |
| 5 | + apply(sourceFile) { |
| 6 | + return this.applyWithWalker( |
| 7 | + new AlwaysFailWalker(sourceFile, this.getOptions()), |
| 8 | + ); |
7 | 9 | } |
8 | | - d.prototype = |
9 | | - b === null ? Object.create(b) : ((__.prototype = b.prototype), new __()); |
10 | | - }; |
11 | | -var Lint = require('tslint'); |
12 | | -var Rule = (function(_super) { |
13 | | - __extends(Rule, _super); |
14 | | - function Rule() { |
15 | | - _super.apply(this, arguments); |
16 | | - } |
17 | | - Rule.prototype.apply = function(sourceFile) { |
18 | | - return this.applyWithWalker( |
19 | | - new AlwaysFailWalker(sourceFile, this.getOptions()), |
20 | | - ); |
21 | | - }; |
22 | | - return Rule; |
23 | | -})(Lint.Rules.AbstractRule); |
| 10 | +} |
| 11 | + |
| 12 | + |
| 13 | +class AlwaysFailWalker extends Lint.RuleWalker { |
| 14 | + |
| 15 | + visitSourceFile(node) { |
| 16 | + this.addFailure( |
| 17 | + this.createFailure(node.getStart(), node.getWidth(), 'failure'), |
| 18 | + ); |
| 19 | + } |
| 20 | +} |
| 21 | + |
24 | 22 | exports.Rule = Rule; |
25 | | -var AlwaysFailWalker = (function(_super) { |
26 | | - __extends(AlwaysFailWalker, _super); |
27 | | - function AlwaysFailWalker() { |
28 | | - _super.apply(this, arguments); |
29 | | - } |
30 | | - AlwaysFailWalker.prototype.visitSourceFile = function(node) { |
31 | | - this.addFailure( |
32 | | - this.createFailure(node.getStart(), node.getWidth(), 'failure'), |
33 | | - ); |
34 | | - }; |
35 | | - return AlwaysFailWalker; |
36 | | -})(Lint.RuleWalker); |
0 commit comments