aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/adjacentOverloadSignaturesRule.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/tslint/lib/rules/adjacentOverloadSignaturesRule.js')
-rw-r--r--node_modules/tslint/lib/rules/adjacentOverloadSignaturesRule.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/node_modules/tslint/lib/rules/adjacentOverloadSignaturesRule.js b/node_modules/tslint/lib/rules/adjacentOverloadSignaturesRule.js
index d3fb5ba1e..62a7bbcff 100644
--- a/node_modules/tslint/lib/rules/adjacentOverloadSignaturesRule.js
+++ b/node_modules/tslint/lib/rules/adjacentOverloadSignaturesRule.js
@@ -32,19 +32,19 @@ var Rule = (function (_super) {
Rule.prototype.apply = function (sourceFile) {
return this.applyWithFunction(sourceFile, walk);
};
+ /* tslint:disable:object-literal-sort-keys */
+ Rule.metadata = {
+ ruleName: "adjacent-overload-signatures",
+ description: "Enforces function overloads to be consecutive.",
+ optionsDescription: "Not configurable.",
+ options: null,
+ optionExamples: [true],
+ rationale: "Improves readability and organization by grouping naturally related items together.",
+ type: "typescript",
+ typescriptOnly: true,
+ };
return Rule;
}(Lint.Rules.AbstractRule));
-/* tslint:disable:object-literal-sort-keys */
-Rule.metadata = {
- ruleName: "adjacent-overload-signatures",
- description: "Enforces function overloads to be consecutive.",
- optionsDescription: "Not configurable.",
- options: null,
- optionExamples: [true],
- rationale: "Improves readability and organization by grouping naturally related items together.",
- type: "typescript",
- typescriptOnly: true,
-};
exports.Rule = Rule;
function walk(ctx) {
var sourceFile = ctx.sourceFile;
@@ -61,7 +61,6 @@ function walk(ctx) {
addFailures(getMisplacedOverloads(members, function (member) {
return utils.isSignatureDeclaration(member) ? getOverloadKey(member) : undefined;
}));
- break;
}
}
return ts.forEachChild(node, cb);
@@ -111,7 +110,7 @@ function getOverloadKey(node) {
if (info === undefined) {
return undefined;
}
- var _a = typeof info === "string" ? [false, info] : [info.computed === true, info.name], computed = _a[0], name = _a[1];
+ var _a = typeof info === "string" ? [false, info] : [info.computed, info.name], computed = _a[0], name = _a[1];
var isStatic = Lint.hasModifier(node.modifiers, ts.SyntaxKind.StaticKeyword);
return (computed ? "0" : "1") + (isStatic ? "0" : "1") + name;
}