UNPKG

1.43 kBJavaScriptView Raw
1var __extends = (this && this.__extends) || function (d, b) {
2 for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3 function __() { this.constructor = d; }
4 __.prototype = b.prototype;
5 d.prototype = new __();
6};
7var ErrorTolerantWalker = require('./utils/ErrorTolerantWalker');
8var Rule = (function (_super) {
9 __extends(Rule, _super);
10 function Rule() {
11 _super.apply(this, arguments);
12 }
13 Rule.prototype.apply = function (sourceFile) {
14 return this.applyWithWalker(new NoEmptyInterfacesRuleWalker(sourceFile, this.getOptions()));
15 };
16 Rule.FAILURE_STRING = 'Do not declare empty interfaces: ';
17 return Rule;
18})(Lint.Rules.AbstractRule);
19exports.Rule = Rule;
20var NoEmptyInterfacesRuleWalker = (function (_super) {
21 __extends(NoEmptyInterfacesRuleWalker, _super);
22 function NoEmptyInterfacesRuleWalker() {
23 _super.apply(this, arguments);
24 }
25 NoEmptyInterfacesRuleWalker.prototype.visitInterfaceDeclaration = function (node) {
26 if (node.members == null || node.members.length === 0) {
27 this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING + '\'' + node.name.getText() + '\''));
28 }
29 _super.prototype.visitInterfaceDeclaration.call(this, node);
30 };
31 return NoEmptyInterfacesRuleWalker;
32})(ErrorTolerantWalker);
33//# sourceMappingURL=noEmptyInterfacesRule.js.map
\No newline at end of file