aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/noInvalidThisRule.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/noInvalidThisRule.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/tslint/lib/rules/noInvalidThisRule.js')
-rw-r--r--node_modules/tslint/lib/rules/noInvalidThisRule.js46
1 files changed, 23 insertions, 23 deletions
diff --git a/node_modules/tslint/lib/rules/noInvalidThisRule.js b/node_modules/tslint/lib/rules/noInvalidThisRule.js
index b2fb22aa5..2c5ce8486 100644
--- a/node_modules/tslint/lib/rules/noInvalidThisRule.js
+++ b/node_modules/tslint/lib/rules/noInvalidThisRule.js
@@ -32,31 +32,31 @@ var Rule = (function (_super) {
var checkFuncInMethod = hasOption(DEPRECATED_OPTION_FUNCTION_IN_METHOD) || hasOption(OPTION_FUNCTION_IN_METHOD);
return this.applyWithFunction(sourceFile, walk, checkFuncInMethod);
};
+ /* tslint:disable:object-literal-sort-keys */
+ Rule.metadata = {
+ ruleName: "no-invalid-this",
+ description: "Disallows using the `this` keyword outside of classes.",
+ rationale: "See [the rule's author's rationale here.](https://github.com/palantir/tslint/pull/1105#issue-147549402)",
+ optionsDescription: (_a = ["\n One argument may be optionally provided:\n\n * `", "` disallows using the `this` keyword in functions within class methods."], _a.raw = ["\n One argument may be optionally provided:\n\n * \\`", "\\` disallows using the \\`this\\` keyword in functions within class methods."], Lint.Utils.dedent(_a, OPTION_FUNCTION_IN_METHOD)),
+ options: {
+ type: "array",
+ items: {
+ type: "string",
+ enum: [OPTION_FUNCTION_IN_METHOD],
+ },
+ minLength: 0,
+ maxLength: 1,
+ },
+ optionExamples: [true, [true, OPTION_FUNCTION_IN_METHOD]],
+ type: "functionality",
+ typescriptOnly: false,
+ };
+ /* tslint:enable:object-literal-sort-keys */
+ Rule.FAILURE_STRING_OUTSIDE = "the \"this\" keyword is disallowed outside of a class body";
+ Rule.FAILURE_STRING_INSIDE = "the \"this\" keyword is disallowed in function bodies inside class methods, " +
+ "use arrow functions instead";
return Rule;
}(Lint.Rules.AbstractRule));
-/* tslint:disable:object-literal-sort-keys */
-Rule.metadata = {
- ruleName: "no-invalid-this",
- description: "Disallows using the `this` keyword outside of classes.",
- rationale: "See [the rule's author's rationale here.](https://github.com/palantir/tslint/pull/1105#issue-147549402)",
- optionsDescription: (_a = ["\n One argument may be optionally provided:\n\n * `", "` disallows using the `this` keyword in functions within class methods."], _a.raw = ["\n One argument may be optionally provided:\n\n * \\`", "\\` disallows using the \\`this\\` keyword in functions within class methods."], Lint.Utils.dedent(_a, OPTION_FUNCTION_IN_METHOD)),
- options: {
- type: "array",
- items: {
- type: "string",
- enum: [OPTION_FUNCTION_IN_METHOD],
- },
- minLength: 0,
- maxLength: 1,
- },
- optionExamples: [true, [true, OPTION_FUNCTION_IN_METHOD]],
- type: "functionality",
- typescriptOnly: false,
-};
-/* tslint:enable:object-literal-sort-keys */
-Rule.FAILURE_STRING_OUTSIDE = "the \"this\" keyword is disallowed outside of a class body";
-Rule.FAILURE_STRING_INSIDE = "the \"this\" keyword is disallowed in function bodies inside class methods, " +
- "use arrow functions instead";
exports.Rule = Rule;
function walk(ctx) {
var sourceFile = ctx.sourceFile, checkFuncInMethod = ctx.options;