aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/preferSwitchRule.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/tslint/lib/rules/preferSwitchRule.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/tslint/lib/rules/preferSwitchRule.js')
-rw-r--r--node_modules/tslint/lib/rules/preferSwitchRule.js34
1 files changed, 17 insertions, 17 deletions
diff --git a/node_modules/tslint/lib/rules/preferSwitchRule.js b/node_modules/tslint/lib/rules/preferSwitchRule.js
index da57daad9..feac8dd80 100644
--- a/node_modules/tslint/lib/rules/preferSwitchRule.js
+++ b/node_modules/tslint/lib/rules/preferSwitchRule.js
@@ -34,25 +34,25 @@ var Rule = (function (_super) {
}
return this.applyWithFunction(sourceFile, walk, minCases);
};
+ /* tslint:disable:object-literal-sort-keys */
+ Rule.metadata = {
+ ruleName: "prefer-switch",
+ description: "Prefer a `switch` statement to an `if` statement with simple `===` comparisons.",
+ optionsDescription: (_a = ["\n An optional object with the property '", "'.\n This is the number cases needed before a switch statement is recommended.\n Defaults to 3."], _a.raw = ["\n An optional object with the property '", "'.\n This is the number cases needed before a switch statement is recommended.\n Defaults to 3."], Lint.Utils.dedent(_a, OPTION_MIN_CASES)),
+ options: {
+ type: "object",
+ properties: (_b = {},
+ _b[OPTION_MIN_CASES] = { type: "number" },
+ _b),
+ },
+ optionExamples: [true, [true, (_c = {}, _c[OPTION_MIN_CASES] = 2, _c)]],
+ type: "style",
+ typescriptOnly: false,
+ };
+ /* tslint:enable:object-literal-sort-keys */
+ Rule.FAILURE_STRING = "Use a switch statement instead of using multiple '===' checks.";
return Rule;
}(Lint.Rules.AbstractRule));
-/* tslint:disable:object-literal-sort-keys */
-Rule.metadata = {
- ruleName: "prefer-switch",
- description: "Prefer a `switch` statement to an `if` statement with simple `===` comparisons.",
- optionsDescription: (_a = ["\n An optional object with the property '", "'.\n This is the number cases needed before a switch statement is recommended.\n Defaults to 3."], _a.raw = ["\n An optional object with the property '", "'.\n This is the number cases needed before a switch statement is recommended.\n Defaults to 3."], Lint.Utils.dedent(_a, OPTION_MIN_CASES)),
- options: {
- type: "object",
- properties: (_b = {},
- _b[OPTION_MIN_CASES] = { type: "number" },
- _b),
- },
- optionExamples: [true, [true, (_c = {}, _c[OPTION_MIN_CASES] = 2, _c)]],
- type: "style",
- typescriptOnly: false,
-};
-/* tslint:enable:object-literal-sort-keys */
-Rule.FAILURE_STRING = "Use a switch statement instead of using multiple '===' checks.";
exports.Rule = Rule;
function walk(ctx) {
var minCases = ctx.options, sourceFile = ctx.sourceFile;