1 | var __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 | };
|
7 | var BannedTermWalker = require('./utils/BannedTermWalker');
|
8 | var Rule = (function (_super) {
|
9 | __extends(Rule, _super);
|
10 | function Rule() {
|
11 | _super.apply(this, arguments);
|
12 | }
|
13 | Rule.prototype.apply = function (sourceFile) {
|
14 | var walker = new BannedTermWalker(sourceFile, this.getOptions(), Rule.FAILURE_STRING, Rule.BANNED_TERMS);
|
15 | return this.applyWithWalker(walker);
|
16 | };
|
17 | Rule.FAILURE_STRING = 'Forbidden reference to reserved keyword: ';
|
18 | Rule.BANNED_TERMS = [
|
19 | 'break', 'case', 'catch', 'class',
|
20 | 'const', 'continue', 'debugger', 'default',
|
21 | 'delete', 'do', 'else', 'enum', 'export',
|
22 | 'extends', 'false', 'finally', 'for',
|
23 | 'function', 'if', 'import', 'in',
|
24 | 'instanceof', 'new', 'null', 'return',
|
25 | 'super', 'switch', 'this', 'throw',
|
26 | 'true', 'try', 'typeof', 'var',
|
27 | 'void', 'while', 'with',
|
28 | 'as', 'implements', 'interface', 'let',
|
29 | 'package', 'private', 'protected',
|
30 | 'public', 'static', 'yield',
|
31 | 'any', 'boolean', 'constructor',
|
32 | 'declare', 'get', 'module',
|
33 | 'require', 'number', 'set',
|
34 | 'string', 'symbol', 'type',
|
35 | 'from', 'of'
|
36 | ];
|
37 | return Rule;
|
38 | })(Lint.Rules.AbstractRule);
|
39 | exports.Rule = Rule;
|
40 |
|
\ | No newline at end of file |