aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/preferTemplateRule.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/preferTemplateRule.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/tslint/lib/rules/preferTemplateRule.js')
-rw-r--r--node_modules/tslint/lib/rules/preferTemplateRule.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/node_modules/tslint/lib/rules/preferTemplateRule.js b/node_modules/tslint/lib/rules/preferTemplateRule.js
index 1b0ae6f69..66eed83b7 100644
--- a/node_modules/tslint/lib/rules/preferTemplateRule.js
+++ b/node_modules/tslint/lib/rules/preferTemplateRule.js
@@ -33,24 +33,24 @@ var Rule = (function (_super) {
var allowSingleConcat = this.ruleArguments.indexOf(OPTION_SINGLE_CONCAT) !== -1;
return this.applyWithFunction(sourceFile, function (ctx) { return walk(ctx, allowSingleConcat); });
};
+ /* tslint:disable:object-literal-sort-keys */
+ Rule.metadata = {
+ ruleName: "prefer-template",
+ description: "Prefer a template expression over string literal concatenation.",
+ optionsDescription: (_a = ["\n If `", "` is specified, then a single concatenation (`x + y`) is allowed, but not more (`x + y + z`)."], _a.raw = ["\n If \\`", "\\` is specified, then a single concatenation (\\`x + y\\`) is allowed, but not more (\\`x + y + z\\`)."], Lint.Utils.dedent(_a, OPTION_SINGLE_CONCAT)),
+ options: {
+ type: "string",
+ enum: [OPTION_SINGLE_CONCAT],
+ },
+ optionExamples: [true, [true, OPTION_SINGLE_CONCAT]],
+ type: "style",
+ typescriptOnly: false,
+ };
+ /* tslint:enable:object-literal-sort-keys */
+ Rule.FAILURE_STRING = "Use a template literal instead of concatenating with a string literal.";
+ Rule.FAILURE_STRING_MULTILINE = "Use a multiline template literal instead of concatenating string literals with newlines.";
return Rule;
}(Lint.Rules.AbstractRule));
-/* tslint:disable:object-literal-sort-keys */
-Rule.metadata = {
- ruleName: "prefer-template",
- description: "Prefer a template expression over string literal concatenation.",
- optionsDescription: (_a = ["\n If `", "` is specified, then a single concatenation (`x + y`) is allowed, but not more (`x + y + z`)."], _a.raw = ["\n If \\`", "\\` is specified, then a single concatenation (\\`x + y\\`) is allowed, but not more (\\`x + y + z\\`)."], Lint.Utils.dedent(_a, OPTION_SINGLE_CONCAT)),
- options: {
- type: "string",
- enum: [OPTION_SINGLE_CONCAT],
- },
- optionExamples: [true, [true, OPTION_SINGLE_CONCAT]],
- type: "style",
- typescriptOnly: false,
-};
-/* tslint:enable:object-literal-sort-keys */
-Rule.FAILURE_STRING = "Use a template literal instead of concatenating with a string literal.";
-Rule.FAILURE_STRING_MULTILINE = "Use a multiline template literal instead of concatenating string literals with newlines.";
exports.Rule = Rule;
function walk(ctx, allowSingleConcat) {
return ts.forEachChild(ctx.sourceFile, function cb(node) {