aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/noVoidExpressionRule.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/noVoidExpressionRule.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/tslint/lib/rules/noVoidExpressionRule.js')
-rw-r--r--node_modules/tslint/lib/rules/noVoidExpressionRule.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/node_modules/tslint/lib/rules/noVoidExpressionRule.js b/node_modules/tslint/lib/rules/noVoidExpressionRule.js
index e80ec2cf6..a580bc5cb 100644
--- a/node_modules/tslint/lib/rules/noVoidExpressionRule.js
+++ b/node_modules/tslint/lib/rules/noVoidExpressionRule.js
@@ -30,28 +30,28 @@ var Rule = (function (_super) {
var ignoreArrowFunctionShorthand = this.ruleArguments.indexOf(OPTION_IGNORE_ARROW_FUNCTION_SHORTHAND) !== -1;
return this.applyWithFunction(sourceFile, function (ctx) { return walk(ctx, program.getTypeChecker()); }, { ignoreArrowFunctionShorthand: ignoreArrowFunctionShorthand });
};
+ /* tslint:disable:object-literal-sort-keys */
+ Rule.metadata = {
+ ruleName: "no-void-expression",
+ description: "Requires expressions of type `void` to appear in statement position.",
+ optionsDescription: (_a = ["\n If `", "` is provided, `() => returnsVoid()` will be allowed.\n Otherwise, it must be written as `() => { returnsVoid(); }`."], _a.raw = ["\n If \\`", "\\` is provided, \\`() => returnsVoid()\\` will be allowed.\n Otherwise, it must be written as \\`() => { returnsVoid(); }\\`."], Lint.Utils.dedent(_a, OPTION_IGNORE_ARROW_FUNCTION_SHORTHAND)),
+ options: {
+ type: "array",
+ items: {
+ type: "string",
+ enum: [OPTION_IGNORE_ARROW_FUNCTION_SHORTHAND],
+ },
+ minLength: 0,
+ maxLength: 1,
+ },
+ requiresTypeInfo: true,
+ type: "functionality",
+ typescriptOnly: false,
+ };
+ /* tslint:enable:object-literal-sort-keys */
+ Rule.FAILURE_STRING = "Expression has type `void`. Put it on its own line as a statement.";
return Rule;
}(Lint.Rules.TypedRule));
-/* tslint:disable:object-literal-sort-keys */
-Rule.metadata = {
- ruleName: "no-void-expression",
- description: "Requires expressions of type `void` to appear in statement position.",
- optionsDescription: (_a = ["\n If `", "` is provided, `() => returnsVoid()` will be allowed.\n Otherwise, it must be written as `() => { returnsVoid(); }`."], _a.raw = ["\n If \\`", "\\` is provided, \\`() => returnsVoid()\\` will be allowed.\n Otherwise, it must be written as \\`() => { returnsVoid(); }\\`."], Lint.Utils.dedent(_a, OPTION_IGNORE_ARROW_FUNCTION_SHORTHAND)),
- options: {
- type: "array",
- items: {
- type: "string",
- enum: [OPTION_IGNORE_ARROW_FUNCTION_SHORTHAND],
- },
- minLength: 0,
- maxLength: 1,
- },
- requiresTypeInfo: true,
- type: "functionality",
- typescriptOnly: false,
-};
-/* tslint:enable:object-literal-sort-keys */
-Rule.FAILURE_STRING = "Expression has type `void`. Put it on its own line as a statement.";
exports.Rule = Rule;
function walk(ctx, checker) {
var sourceFile = ctx.sourceFile, ignoreArrowFunctionShorthand = ctx.options.ignoreArrowFunctionShorthand;