diff options
Diffstat (limited to 'node_modules/tslint/lib/rules/labelPositionRule.js')
-rw-r--r-- | node_modules/tslint/lib/rules/labelPositionRule.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/node_modules/tslint/lib/rules/labelPositionRule.js b/node_modules/tslint/lib/rules/labelPositionRule.js index e90ee4a77..ef961ee4c 100644 --- a/node_modules/tslint/lib/rules/labelPositionRule.js +++ b/node_modules/tslint/lib/rules/labelPositionRule.js @@ -28,22 +28,22 @@ var Rule = (function (_super) { Rule.prototype.apply = function (sourceFile) { return this.applyWithFunction(sourceFile, walk); }; + /* tslint:disable:object-literal-sort-keys */ + Rule.metadata = { + ruleName: "label-position", + description: "Only allows labels in sensible locations.", + descriptionDetails: "This rule only allows labels to be on `do/for/while/switch` statements.", + rationale: (_a = ["\n Labels in JavaScript only can be used in conjunction with `break` or `continue`,\n constructs meant to be used for loop flow control. While you can theoretically use\n labels on any block statement in JS, it is considered poor code structure to do so."], _a.raw = ["\n Labels in JavaScript only can be used in conjunction with \\`break\\` or \\`continue\\`,\n constructs meant to be used for loop flow control. While you can theoretically use\n labels on any block statement in JS, it is considered poor code structure to do so."], Lint.Utils.dedent(_a)), + optionsDescription: "Not configurable.", + options: null, + optionExamples: [true], + type: "functionality", + typescriptOnly: false, + }; + /* tslint:enable:object-literal-sort-keys */ + Rule.FAILURE_STRING = "unexpected label on statement"; return Rule; }(Lint.Rules.AbstractRule)); -/* tslint:disable:object-literal-sort-keys */ -Rule.metadata = { - ruleName: "label-position", - description: "Only allows labels in sensible locations.", - descriptionDetails: "This rule only allows labels to be on `do/for/while/switch` statements.", - rationale: (_a = ["\n Labels in JavaScript only can be used in conjunction with `break` or `continue`,\n constructs meant to be used for loop flow control. While you can theoretically use\n labels on any block statement in JS, it is considered poor code structure to do so."], _a.raw = ["\n Labels in JavaScript only can be used in conjunction with \\`break\\` or \\`continue\\`,\n constructs meant to be used for loop flow control. While you can theoretically use\n labels on any block statement in JS, it is considered poor code structure to do so."], Lint.Utils.dedent(_a)), - optionsDescription: "Not configurable.", - options: null, - optionExamples: [true], - type: "functionality", - typescriptOnly: false, -}; -/* tslint:enable:object-literal-sort-keys */ -Rule.FAILURE_STRING = "unexpected label on statement"; exports.Rule = Rule; function walk(ctx) { return ts.forEachChild(ctx.sourceFile, function cb(node) { |