aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/completedDocsRule.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
commit0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch)
treef9864d4a4148621378958794cbbfdc2393733283 /node_modules/tslint/lib/rules/completedDocsRule.js
parent6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff)
upgrade dependencies
Diffstat (limited to 'node_modules/tslint/lib/rules/completedDocsRule.js')
-rw-r--r--node_modules/tslint/lib/rules/completedDocsRule.js301
1 files changed, 147 insertions, 154 deletions
diff --git a/node_modules/tslint/lib/rules/completedDocsRule.js b/node_modules/tslint/lib/rules/completedDocsRule.js
index 5c3bf5cf2..d64315563 100644
--- a/node_modules/tslint/lib/rules/completedDocsRule.js
+++ b/node_modules/tslint/lib/rules/completedDocsRule.js
@@ -20,7 +20,7 @@ var tslib_1 = require("tslib");
var tsutils_1 = require("tsutils");
var ts = require("typescript");
var Lint = require("../index");
-var utils_1 = require("../utils");
+var exclusionFactory_1 = require("./completed-docs/exclusionFactory");
exports.ALL = "all";
exports.ARGUMENT_CLASSES = "classes";
exports.ARGUMENT_ENUMS = "enums";
@@ -32,6 +32,7 @@ exports.ARGUMENT_NAMESPACES = "namespaces";
exports.ARGUMENT_PROPERTIES = "properties";
exports.ARGUMENT_TYPES = "types";
exports.ARGUMENT_VARIABLES = "variables";
+exports.DESCRIPTOR_TAGS = "tags";
exports.DESCRIPTOR_LOCATIONS = "locations";
exports.DESCRIPTOR_PRIVACIES = "privacies";
exports.DESCRIPTOR_VISIBILITIES = "visibilities";
@@ -40,36 +41,76 @@ exports.LOCATION_STATIC = "static";
exports.PRIVACY_PRIVATE = "private";
exports.PRIVACY_PROTECTED = "protected";
exports.PRIVACY_PUBLIC = "public";
+exports.TAGS_FOR_CONTENT = "content";
+exports.TAGS_FOR_EXISTENCE = "exists";
exports.VISIBILITY_EXPORTED = "exported";
exports.VISIBILITY_INTERNAL = "internal";
var Rule = /** @class */ (function (_super) {
tslib_1.__extends(Rule, _super);
function Rule() {
- return _super !== null && _super.apply(this, arguments) || this;
+ var _this = _super !== null && _super.apply(this, arguments) || this;
+ /* tslint:enable:object-literal-sort-keys */
+ _this.exclusionFactory = new exclusionFactory_1.ExclusionFactory();
+ return _this;
}
- /* tslint:enable:object-literal-sort-keys */
Rule.prototype.applyWithProgram = function (sourceFile, program) {
var options = this.getOptions();
var completedDocsWalker = new CompletedDocsWalker(sourceFile, options, program);
- completedDocsWalker.setRequirements(this.getRequirements(options.ruleArguments));
+ completedDocsWalker.setExclusionsMap(this.getExclusionsMap(options.ruleArguments));
return this.applyWithWalker(completedDocsWalker);
};
- Rule.prototype.getRequirements = function (ruleArguments) {
+ Rule.prototype.getExclusionsMap = function (ruleArguments) {
if (ruleArguments.length === 0) {
- ruleArguments = Rule.defaultArguments;
+ ruleArguments = [Rule.defaultArguments];
}
- return Requirement.constructRequirements(ruleArguments);
+ return this.exclusionFactory.constructExclusionsMap(ruleArguments);
};
Rule.FAILURE_STRING_EXIST = "Documentation must exist for ";
- Rule.defaultArguments = [
- exports.ARGUMENT_CLASSES,
- exports.ARGUMENT_FUNCTIONS,
- exports.ARGUMENT_METHODS,
- exports.ARGUMENT_PROPERTIES,
- ];
+ Rule.defaultArguments = (_a = {},
+ _a[exports.ARGUMENT_CLASSES] = true,
+ _a[exports.ARGUMENT_FUNCTIONS] = true,
+ _a[exports.ARGUMENT_METHODS] = (_b = {},
+ _b[exports.DESCRIPTOR_TAGS] = (_c = {},
+ _c[exports.TAGS_FOR_CONTENT] = {
+ see: ".*",
+ },
+ _c[exports.TAGS_FOR_EXISTENCE] = [
+ "deprecated",
+ "inheritdoc",
+ ],
+ _c),
+ _b),
+ _a[exports.ARGUMENT_PROPERTIES] = (_d = {},
+ _d[exports.DESCRIPTOR_TAGS] = (_e = {},
+ _e[exports.TAGS_FOR_CONTENT] = {
+ see: ".*",
+ },
+ _e[exports.TAGS_FOR_EXISTENCE] = [
+ "deprecated",
+ "inheritdoc",
+ ],
+ _e),
+ _d),
+ _a);
Rule.ARGUMENT_DESCRIPTOR_BLOCK = {
- properties: (_a = {},
- _a[exports.DESCRIPTOR_VISIBILITIES] = {
+ properties: (_f = {},
+ _f[exports.DESCRIPTOR_TAGS] = {
+ properties: (_g = {},
+ _g[exports.TAGS_FOR_CONTENT] = {
+ items: {
+ type: "string",
+ },
+ type: "object",
+ },
+ _g[exports.TAGS_FOR_EXISTENCE] = {
+ items: {
+ type: "string",
+ },
+ type: "array",
+ },
+ _g),
+ },
+ _f[exports.DESCRIPTOR_VISIBILITIES] = {
enum: [
exports.ALL,
exports.VISIBILITY_EXPORTED,
@@ -77,12 +118,28 @@ var Rule = /** @class */ (function (_super) {
],
type: "string",
},
- _a),
+ _f),
type: "object",
};
Rule.ARGUMENT_DESCRIPTOR_CLASS = {
- properties: (_b = {},
- _b[exports.DESCRIPTOR_LOCATIONS] = {
+ properties: (_h = {},
+ _h[exports.DESCRIPTOR_TAGS] = {
+ properties: (_j = {},
+ _j[exports.TAGS_FOR_CONTENT] = {
+ items: {
+ type: "string",
+ },
+ type: "object",
+ },
+ _j[exports.TAGS_FOR_EXISTENCE] = {
+ items: {
+ type: "string",
+ },
+ type: "array",
+ },
+ _j),
+ },
+ _h[exports.DESCRIPTOR_LOCATIONS] = {
enum: [
exports.ALL,
exports.LOCATION_INSTANCE,
@@ -90,7 +147,7 @@ var Rule = /** @class */ (function (_super) {
],
type: "string",
},
- _b[exports.DESCRIPTOR_PRIVACIES] = {
+ _h[exports.DESCRIPTOR_PRIVACIES] = {
enum: [
exports.ALL,
exports.PRIVACY_PRIVATE,
@@ -99,36 +156,46 @@ var Rule = /** @class */ (function (_super) {
],
type: "string",
},
- _b),
+ _h),
type: "object",
};
/* tslint:disable:object-literal-sort-keys */
Rule.metadata = {
ruleName: "completed-docs",
description: "Enforces documentation for important items be filled out.",
- optionsDescription: (_c = ["\n `true` to enable for [\"", "\", \"", "\", \"", "\", \"", "\"],\n or an array with each item in one of two formats:\n\n * `string` to enable for that type\n * `object` keying types to when their documentation is required:\n * `\"", "\"` and `\"", "\"` may specify:\n * `\"", "\"`:\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`:\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * All other types may specify `\"", "\"`:\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n\n Types that may be enabled are:\n\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`"], _c.raw = ["\n \\`true\\` to enable for [\"", "\", \"", "\", \"", "\", \"", "\"],\n or an array with each item in one of two formats:\n\n * \\`string\\` to enable for that type\n * \\`object\\` keying types to when their documentation is required:\n * \\`\"", "\"\\` and \\`\"", "\"\\` may specify:\n * \\`\"", "\"\\`:\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`:\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * All other types may specify \\`\"", "\"\\`:\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n\n Types that may be enabled are:\n\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`"], Lint.Utils.dedent(_c, exports.ARGUMENT_CLASSES, exports.ARGUMENT_FUNCTIONS, exports.ARGUMENT_METHODS, exports.ARGUMENT_PROPERTIES, exports.ARGUMENT_METHODS, exports.ARGUMENT_PROPERTIES, exports.DESCRIPTOR_PRIVACIES, exports.ALL, exports.PRIVACY_PRIVATE, exports.PRIVACY_PROTECTED, exports.PRIVACY_PUBLIC, exports.DESCRIPTOR_LOCATIONS, exports.ALL, exports.LOCATION_INSTANCE, exports.LOCATION_STATIC, exports.DESCRIPTOR_VISIBILITIES, exports.ALL, exports.VISIBILITY_EXPORTED, exports.VISIBILITY_INTERNAL, exports.ARGUMENT_CLASSES, exports.ARGUMENT_ENUMS, exports.ARGUMENT_ENUM_MEMBERS, exports.ARGUMENT_FUNCTIONS, exports.ARGUMENT_INTERFACES, exports.ARGUMENT_METHODS, exports.ARGUMENT_NAMESPACES, exports.ARGUMENT_PROPERTIES, exports.ARGUMENT_TYPES, exports.ARGUMENT_VARIABLES)),
+ optionsDescription: (_k = ["\n `true` to enable for [", "]],\n or an array with each item in one of two formats:\n\n * `string` to enable for that type\n * `object` keying types to when their documentation is required:\n * `\"", "\"` and `\"", "\"` may specify:\n * `\"", "\"`:\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`:\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * Other types may specify `\"", "\"`:\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * All types may also provide `\"", "\"`\n with members specifying tags that allow the docs to not have a body.\n * `\"", "\"`: Object mapping tags to `RegExp` bodies content allowed to count as complete docs.\n * `\"", "\"`: Array of tags that must only exist to count as complete docs.\n\n Types that may be enabled are:\n\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`\n * `\"", "\"`"], _k.raw = ["\n \\`true\\` to enable for [", "]],\n or an array with each item in one of two formats:\n\n * \\`string\\` to enable for that type\n * \\`object\\` keying types to when their documentation is required:\n * \\`\"", "\"\\` and \\`\"", "\"\\` may specify:\n * \\`\"", "\"\\`:\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`:\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * Other types may specify \\`\"", "\"\\`:\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * All types may also provide \\`\"", "\"\\`\n with members specifying tags that allow the docs to not have a body.\n * \\`\"", "\"\\`: Object mapping tags to \\`RegExp\\` bodies content allowed to count as complete docs.\n * \\`\"", "\"\\`: Array of tags that must only exist to count as complete docs.\n\n Types that may be enabled are:\n\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`\n * \\`\"", "\"\\`"], Lint.Utils.dedent(_k, Object.keys(Rule.defaultArguments).join(", "), exports.ARGUMENT_METHODS, exports.ARGUMENT_PROPERTIES, exports.DESCRIPTOR_PRIVACIES, exports.ALL, exports.PRIVACY_PRIVATE, exports.PRIVACY_PROTECTED, exports.PRIVACY_PUBLIC, exports.DESCRIPTOR_LOCATIONS, exports.ALL, exports.LOCATION_INSTANCE, exports.LOCATION_STATIC, exports.DESCRIPTOR_VISIBILITIES, exports.ALL, exports.VISIBILITY_EXPORTED, exports.VISIBILITY_INTERNAL, exports.DESCRIPTOR_TAGS, exports.TAGS_FOR_CONTENT, exports.TAGS_FOR_EXISTENCE, exports.ARGUMENT_CLASSES, exports.ARGUMENT_ENUMS, exports.ARGUMENT_ENUM_MEMBERS, exports.ARGUMENT_FUNCTIONS, exports.ARGUMENT_INTERFACES, exports.ARGUMENT_METHODS, exports.ARGUMENT_NAMESPACES, exports.ARGUMENT_PROPERTIES, exports.ARGUMENT_TYPES, exports.ARGUMENT_VARIABLES)),
options: {
type: "array",
items: {
anyOf: [
{
- enum: Rule.defaultArguments,
+ options: [
+ exports.ARGUMENT_CLASSES,
+ exports.ARGUMENT_ENUMS,
+ exports.ARGUMENT_FUNCTIONS,
+ exports.ARGUMENT_INTERFACES,
+ exports.ARGUMENT_METHODS,
+ exports.ARGUMENT_NAMESPACES,
+ exports.ARGUMENT_PROPERTIES,
+ exports.ARGUMENT_TYPES,
+ exports.ARGUMENT_VARIABLES,
+ ],
type: "string",
},
{
type: "object",
- properties: (_d = {},
- _d[exports.ARGUMENT_CLASSES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
- _d[exports.ARGUMENT_ENUMS] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
- _d[exports.ARGUMENT_ENUM_MEMBERS] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
- _d[exports.ARGUMENT_FUNCTIONS] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
- _d[exports.ARGUMENT_INTERFACES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
- _d[exports.ARGUMENT_METHODS] = Rule.ARGUMENT_DESCRIPTOR_CLASS,
- _d[exports.ARGUMENT_NAMESPACES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
- _d[exports.ARGUMENT_PROPERTIES] = Rule.ARGUMENT_DESCRIPTOR_CLASS,
- _d[exports.ARGUMENT_TYPES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
- _d[exports.ARGUMENT_VARIABLES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
- _d),
+ properties: (_l = {},
+ _l[exports.ARGUMENT_CLASSES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
+ _l[exports.ARGUMENT_ENUMS] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
+ _l[exports.ARGUMENT_ENUM_MEMBERS] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
+ _l[exports.ARGUMENT_FUNCTIONS] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
+ _l[exports.ARGUMENT_INTERFACES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
+ _l[exports.ARGUMENT_METHODS] = Rule.ARGUMENT_DESCRIPTOR_CLASS,
+ _l[exports.ARGUMENT_NAMESPACES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
+ _l[exports.ARGUMENT_PROPERTIES] = Rule.ARGUMENT_DESCRIPTOR_CLASS,
+ _l[exports.ARGUMENT_TYPES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
+ _l[exports.ARGUMENT_VARIABLES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
+ _l),
},
],
},
@@ -138,118 +205,38 @@ var Rule = /** @class */ (function (_super) {
[true, exports.ARGUMENT_ENUMS, exports.ARGUMENT_FUNCTIONS, exports.ARGUMENT_METHODS],
[
true,
- (_e = {},
- _e[exports.ARGUMENT_ENUMS] = true,
- _e[exports.ARGUMENT_FUNCTIONS] = (_f = {},
- _f[exports.DESCRIPTOR_VISIBILITIES] = [exports.VISIBILITY_EXPORTED],
- _f),
- _e[exports.ARGUMENT_METHODS] = (_g = {},
- _g[exports.DESCRIPTOR_LOCATIONS] = exports.LOCATION_INSTANCE,
- _g[exports.DESCRIPTOR_PRIVACIES] = [exports.PRIVACY_PUBLIC, exports.PRIVACY_PROTECTED],
- _g),
- _e),
+ (_m = {},
+ _m[exports.ARGUMENT_ENUMS] = true,
+ _m[exports.ARGUMENT_FUNCTIONS] = (_o = {},
+ _o[exports.DESCRIPTOR_VISIBILITIES] = [exports.VISIBILITY_EXPORTED],
+ _o),
+ _m[exports.ARGUMENT_METHODS] = (_p = {},
+ _p[exports.DESCRIPTOR_LOCATIONS] = exports.LOCATION_INSTANCE,
+ _p[exports.DESCRIPTOR_PRIVACIES] = [exports.PRIVACY_PUBLIC, exports.PRIVACY_PROTECTED],
+ _p),
+ _m[exports.DESCRIPTOR_TAGS] = (_q = {},
+ _q[exports.TAGS_FOR_CONTENT] = {
+ see: ["#.*"],
+ },
+ _q[exports.TAGS_FOR_EXISTENCE] = ["inheritdoc"],
+ _q),
+ _m),
],
],
type: "style",
typescriptOnly: false,
+ requiresTypeInfo: true,
};
return Rule;
}(Lint.Rules.TypedRule));
exports.Rule = Rule;
-var Requirement = /** @class */ (function () {
- // tslint:disable-next-line no-object-literal-type-assertion
- function Requirement(descriptor) {
- if (descriptor === void 0) { descriptor = {}; }
- this.descriptor = descriptor;
- }
- Requirement.constructRequirements = function (ruleArguments) {
- var requirements = new Map();
- for (var _i = 0, ruleArguments_1 = ruleArguments; _i < ruleArguments_1.length; _i++) {
- var ruleArgument = ruleArguments_1[_i];
- Requirement.addRequirements(requirements, ruleArgument);
- }
- return requirements;
- };
- Requirement.addRequirements = function (requirements, descriptor) {
- if (typeof descriptor === "string") {
- requirements.set(descriptor, new BlockRequirement());
- return;
- }
- for (var type in descriptor) {
- if (utils_1.hasOwnProperty(descriptor, type)) {
- requirements.set(type, (type === "methods" || type === "properties")
- ? new ClassRequirement(descriptor[type])
- : new BlockRequirement(descriptor[type]));
- }
- }
- };
- Requirement.prototype.createSet = function (values) {
- if (values === undefined || values.length === 0) {
- values = [exports.ALL];
- }
- return new Set(values);
- };
- return Requirement;
-}());
-var BlockRequirement = /** @class */ (function (_super) {
- tslib_1.__extends(BlockRequirement, _super);
- function BlockRequirement() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.visibilities = _this.createSet(_this.descriptor.visibilities);
- return _this;
- }
- BlockRequirement.prototype.shouldNodeBeDocumented = function (node) {
- if (this.visibilities.has(exports.ALL)) {
- return true;
- }
- if (Lint.hasModifier(node.modifiers, ts.SyntaxKind.ExportKeyword)) {
- return this.visibilities.has(exports.VISIBILITY_EXPORTED);
- }
- return this.visibilities.has(exports.VISIBILITY_INTERNAL);
- };
- return BlockRequirement;
-}(Requirement));
-var ClassRequirement = /** @class */ (function (_super) {
- tslib_1.__extends(ClassRequirement, _super);
- function ClassRequirement() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.locations = _this.createSet(_this.descriptor.locations);
- _this.privacies = _this.createSet(_this.descriptor.privacies);
- return _this;
- }
- ClassRequirement.prototype.shouldNodeBeDocumented = function (node) {
- return this.shouldLocationBeDocumented(node) && this.shouldPrivacyBeDocumented(node);
- };
- ClassRequirement.prototype.shouldLocationBeDocumented = function (node) {
- if (this.locations.has(exports.ALL)) {
- return true;
- }
- if (Lint.hasModifier(node.modifiers, ts.SyntaxKind.StaticKeyword)) {
- return this.locations.has(exports.LOCATION_STATIC);
- }
- return this.locations.has(exports.LOCATION_INSTANCE);
- };
- ClassRequirement.prototype.shouldPrivacyBeDocumented = function (node) {
- if (this.privacies.has(exports.ALL)) {
- return true;
- }
- if (Lint.hasModifier(node.modifiers, ts.SyntaxKind.PrivateKeyword)) {
- return this.privacies.has(exports.PRIVACY_PRIVATE);
- }
- if (Lint.hasModifier(node.modifiers, ts.SyntaxKind.ProtectedKeyword)) {
- return this.privacies.has(exports.PRIVACY_PROTECTED);
- }
- return this.privacies.has(exports.PRIVACY_PUBLIC);
- };
- return ClassRequirement;
-}(Requirement));
var CompletedDocsWalker = /** @class */ (function (_super) {
tslib_1.__extends(CompletedDocsWalker, _super);
function CompletedDocsWalker() {
return _super !== null && _super.apply(this, arguments) || this;
}
- CompletedDocsWalker.prototype.setRequirements = function (requirements) {
- this.requirements = requirements;
+ CompletedDocsWalker.prototype.setExclusionsMap = function (exclusionsMap) {
+ this.exclusionsMap = exclusionsMap;
};
CompletedDocsWalker.prototype.visitClassDeclaration = function (node) {
this.checkNode(node, exports.ARGUMENT_CLASSES);
@@ -293,6 +280,29 @@ var CompletedDocsWalker = /** @class */ (function (_super) {
this.checkVariable(node);
_super.prototype.visitVariableDeclaration.call(this, node);
};
+ CompletedDocsWalker.prototype.checkNode = function (node, nodeType, requirementNode) {
+ if (requirementNode === void 0) { requirementNode = node; }
+ var name = node.name;
+ if (name === undefined) {
+ return;
+ }
+ var exclusions = this.exclusionsMap.get(nodeType);
+ if (exclusions === undefined) {
+ return;
+ }
+ for (var _i = 0, exclusions_1 = exclusions; _i < exclusions_1.length; _i++) {
+ var exclusion = exclusions_1[_i];
+ if (exclusion.excludes(requirementNode)) {
+ return;
+ }
+ }
+ var symbol = this.getTypeChecker().getSymbolAtLocation(name);
+ if (symbol === undefined) {
+ return;
+ }
+ var comments = symbol.getDocumentationComment();
+ this.checkComments(node, this.describeNode(nodeType), comments, requirementNode);
+ };
CompletedDocsWalker.prototype.checkVariable = function (node) {
// Only check variables in variable declaration lists
// and not variables in catch clauses and for loops.
@@ -312,26 +322,6 @@ var CompletedDocsWalker = /** @class */ (function (_super) {
this.checkNode(node, exports.ARGUMENT_VARIABLES, statement);
}
};
- CompletedDocsWalker.prototype.checkNode = function (node, nodeType, requirementNode) {
- if (requirementNode === void 0) { requirementNode = node; }
- var name = node.name;
- if (name === undefined) {
- return;
- }
- var requirement = this.requirements.get(nodeType);
- if (requirement === undefined || !requirement.shouldNodeBeDocumented(requirementNode)) {
- return;
- }
- var symbol = this.getTypeChecker().getSymbolAtLocation(name);
- if (symbol === undefined) {
- return;
- }
- var comments = symbol.getDocumentationComment();
- this.checkComments(node, this.describeNode(nodeType), comments, requirementNode);
- };
- CompletedDocsWalker.prototype.describeNode = function (nodeType) {
- return nodeType.replace("-", " ");
- };
CompletedDocsWalker.prototype.checkComments = function (node, nodeDescriptor, comments, requirementNode) {
if (comments.map(function (comment) { return comment.text; }).join("").trim() === "") {
this.addDocumentationFailure(node, nodeDescriptor, requirementNode);
@@ -356,9 +346,12 @@ var CompletedDocsWalker = /** @class */ (function (_super) {
var alias = CompletedDocsWalker.modifierAliases[description];
return alias !== undefined ? alias : description;
};
+ CompletedDocsWalker.prototype.describeNode = function (nodeType) {
+ return nodeType.replace("-", " ");
+ };
CompletedDocsWalker.modifierAliases = {
export: "exported",
};
return CompletedDocsWalker;
}(Lint.ProgramAwareRuleWalker));
-var _a, _b, _c, _d, _e, _f, _g;
+var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;