Skip to content

Commit

Permalink
Broadened to skip all operators.
Browse files Browse the repository at this point in the history
  • Loading branch information
pq committed Oct 24, 2017
1 parent 20e2e9c commit 3ead7be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 1 addition & 4 deletions lib/src/rules/avoid_positional_boolean_parameters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ new Button(ButtonState.enabled);
bool _hasInheritedMethod(MethodDeclaration node) =>
DartTypeUtilities.lookUpInheritedMethod(node) != null;

bool _indexEqOp(MethodDeclaration node) =>
node.isOperator && node.name.token.type == TokenType.INDEX_EQ;

bool _isNamedParameter(FormalParameter node) =>
node.kind == ParameterKind.NAMED;

Expand Down Expand Up @@ -88,7 +85,7 @@ class _Visitor extends SimpleAstVisitor {
visitMethodDeclaration(MethodDeclaration node) {
if (!node.isSetter &&
!node.element.isPrivate &&
!_indexEqOp(node) &&
!node.isOperator &&
!_hasInheritedMethod(node)) {
final parametersToLint =
node.parameters?.parameters?.where(_isFormalParameterToLint);
Expand Down
5 changes: 5 additions & 0 deletions test/rules/avoid_positional_boolean_parameters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class C {
void operator []=(int index, bool value) { // OK (#803)
}

void operator +(bool value) { // OK (#803)
}

void operator -(bool value) { // OK (#803)
}
}

class D {
Expand Down

0 comments on commit 3ead7be

Please sign in to comment.