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