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