noConsoleRule.js 928 B

123456789101112131415161718192021222324
  1. "use strict";
  2. var __extends = (this && this.__extends) || function (d, b) {
  3. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4. function __() { this.constructor = d; }
  5. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6. };
  7. var BanRule = require("./banRule");
  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 options = this.getOptions();
  15. var consoleBanWalker = new BanRule.BanFunctionWalker(sourceFile, this.getOptions());
  16. for (var _i = 0, _a = options.ruleArguments; _i < _a.length; _i++) {
  17. var option = _a[_i];
  18. consoleBanWalker.addBannedFunction(["console", option]);
  19. }
  20. return this.applyWithWalker(consoleBanWalker);
  21. };
  22. return Rule;
  23. }(BanRule.Rule));
  24. exports.Rule = Rule;