UNPKG

2 kBJavaScriptView Raw
1"use strict";
2var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 return extendStatics(d, b);
8 }
9 return function (d, b) {
10 extendStatics(d, b);
11 function __() { this.constructor = d; }
12 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 };
14})();
15Object.defineProperty(exports, "__esModule", { value: true });
16var Lint = require("tslint");
17var createNoStringParameterToFunctionWalker_1 = require("./utils/createNoStringParameterToFunctionWalker");
18var Rule = (function (_super) {
19 __extends(Rule, _super);
20 function Rule() {
21 return _super !== null && _super.apply(this, arguments) || this;
22 }
23 Rule.prototype.apply = function (sourceFile) {
24 return this.applyWithProgram(sourceFile, undefined);
25 };
26 Rule.prototype.applyWithProgram = function (sourceFile, program) {
27 return this.applyWithFunction(sourceFile, createNoStringParameterToFunctionWalker_1.createNoStringParameterToFunctionWalker('setInterval', this.getOptions(), program));
28 };
29 Rule.metadata = {
30 ruleName: 'no-string-based-set-interval',
31 type: 'maintainability',
32 description: 'Do not use the version of setInterval that accepts code as a string argument.',
33 options: null,
34 optionsDescription: '',
35 typescriptOnly: true,
36 issueClass: 'SDL',
37 issueType: 'Error',
38 severity: 'Critical',
39 level: 'Mandatory',
40 group: 'Security',
41 commonWeaknessEnumeration: '95, 676, 242, 116'
42 };
43 return Rule;
44}(Lint.Rules.OptionallyTypedRule));
45exports.Rule = Rule;
46//# sourceMappingURL=noStringBasedSetIntervalRule.js.map
\No newline at end of file