Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Adding "allow-declarations" to only-arrow-functions #1452

Merged
merged 12 commits into from
Aug 9, 2016
2 changes: 1 addition & 1 deletion src/rules/onlyArrowFunctionsRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class Rule extends Lint.Rules.AbstractRule {

class OnlyArrowFunctionsWalker extends Lint.RuleWalker {
public visitFunctionDeclaration(node: ts.FunctionDeclaration) {
if (this.getOptions().indexOf(OPTION_ALLOW_DECLARATIONS) === -1) {
if (this.hasOption(OPTION_ALLOW_DECLARATIONS)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, I should have suggested !this.hasOption, I think the logic got inverted here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm.

this.addFailure(this.createFailure(node.getStart(), "function".length, Rule.FAILURE_STRING));
}
super.visitFunctionDeclaration(node);
Expand Down