diff options
Diffstat (limited to 'node_modules/tslint/lib/rules/preferTemplateRule.js')
-rw-r--r-- | node_modules/tslint/lib/rules/preferTemplateRule.js | 32 |
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) { |