Skip to content

Commit

Permalink
fix: use type args in boolean prop naming rule
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryBrown0 committed Sep 4, 2023
1 parent 2dbe952 commit 4dd303d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/rules/boolean-prop-naming.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,16 @@ module.exports = {
&& component.node.parent.id.type === 'Identifier'
&& component.node.parent.id.typeAnnotation
&& component.node.parent.id.typeAnnotation.typeAnnotation
&& component.node.parent.id.typeAnnotation.typeAnnotation.typeParameters
&& (
component.node.parent.id.typeAnnotation.typeAnnotation.typeParameters.type === 'TSTypeParameterInstantiation'
(component.node.parent.id.typeAnnotation.typeAnnotation.typeArguments
&& (
component.node.parent.id.typeAnnotation.typeAnnotation.typeArguments.type === 'TSTypeParameterInstantiation'
|| component.node.parent.id.typeAnnotation.typeAnnotation.typeArguments.type === 'TypeParameterInstantiation'

Check warning on line 253 in lib/rules/boolean-prop-naming.js

View check run for this annotation

Codecov / codecov/patch

lib/rules/boolean-prop-naming.js#L252-L253

Added lines #L252 - L253 were not covered by tests
))
|| (component.node.parent.id.typeAnnotation.typeAnnotation.typeParameters
&& (component.node.parent.id.typeAnnotation.typeAnnotation.typeParameters.type === 'TSTypeParameterInstantiation'
|| component.node.parent.id.typeAnnotation.typeAnnotation.typeParameters.type === 'TypeParameterInstantiation'
))
)
) {
return component.node.parent.id.typeAnnotation.typeAnnotation.typeParameters.params.find(
Expand Down

0 comments on commit 4dd303d

Please sign in to comment.