noQueriesMetadataPropertyRule.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. "use strict";
  2. var __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. })();
  15. var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
  16. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17. return cooked;
  18. };
  19. Object.defineProperty(exports, "__esModule", { value: true });
  20. var utils_1 = require("tslint/lib/utils");
  21. var metadataPropertyBase_1 = require("./metadataPropertyBase");
  22. var utils_2 = require("./util/utils");
  23. var METADATA_PROPERTY_NAME = 'queries';
  24. var Rule = (function (_super) {
  25. __extends(Rule, _super);
  26. function Rule(options) {
  27. return _super.call(this, {
  28. errorMessage: Rule.FAILURE_STRING,
  29. propertyName: METADATA_PROPERTY_NAME
  30. }, options) || this;
  31. }
  32. Rule.metadata = {
  33. description: "Disallows usage of the `" + METADATA_PROPERTY_NAME + "` metadata property.",
  34. options: null,
  35. optionsDescription: 'Not configurable.',
  36. rationale: utils_1.dedent(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n If you ever need to rename the property associated\n with @", ",\n @", ", @", "\n or @", ",\n you can modify it in a single place.\n "], ["\n If you ever need to rename the property associated\n with @", ",\n @", ", @", "\n or @", ",\n you can modify it in a single place.\n "])), utils_2.AngularInnerClassDecorators.ContentChild, utils_2.AngularInnerClassDecorators.ContentChildren, utils_2.AngularInnerClassDecorators.ViewChild, utils_2.AngularInnerClassDecorators.ViewChildren),
  37. ruleName: 'no-queries-metadata-property',
  38. type: 'style',
  39. typescriptOnly: true
  40. };
  41. Rule.FAILURE_STRING = utils_1.dedent(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n Use @", ",\n @", ",\n @", "\n or @", "\n rather than the `", "` metadata property\n "], ["\n Use @", ",\n @", ",\n @", "\n or @", "\n rather than the \\`", "\\` metadata property\n "])), utils_2.AngularInnerClassDecorators.ContentChild, utils_2.AngularInnerClassDecorators.ContentChildren, utils_2.AngularInnerClassDecorators.ViewChild, utils_2.AngularInnerClassDecorators.ViewChildren, METADATA_PROPERTY_NAME);
  42. return Rule;
  43. }(metadataPropertyBase_1.MetadataPropertyBase));
  44. exports.Rule = Rule;
  45. var templateObject_1, templateObject_2;