-
Notifications
You must be signed in to change notification settings - Fork 198
Conversation
hmm, if this is is typescript, the only time i’d be able to tell if the area element is in a map element is if they’re both there together in their “literal” form right? |
Sorry @Chovin I don't follow. Do you mean that the only way to tell is if the literals are together, like this? <map ...>
<area ... />
</map> ...rather than: <SomeComponentThatReturnsAMap>
<area ... />
</SomeComponentThatReturnsAMap> If that's the case, then yes - there isn't a (known?) good way to validate what JSX elements are returned by a method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you have a build failure:
src/reactA11yImgHasAltRule.ts(87,51): error TS2339: Property 'parentNode' does not exist on type 'JsxOpeningLikeElement'.
Property 'parentNode' does not exist on type 'JsxSelfClosingElement'.
Are you missing a cast somewhere, or is that meant to be node.parent
?
@JoshuaKGoldberg ah I see. I'm assuming that's the best we can do here and just ignore cases like this? <SomeComponentThatReturnsAMap>
<area ... />
</SomeComponentThatReturnsAMap> |
hmm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it should work, super. Let's add some tests to ReactA11yImgHasAltRuleTests
.
Awesome! I’ll get to that test soon. Thanks! |
Ping @Chovin, are you still available to finish up this PR? Looks like it'd be a good one to have in. |
I’d like to get back to this but will have to do so in a few weeks. Thanks for following up @JoshuaKGoldberg ! |
Closing now to keep the queue small so others feel welcome to take this on themselves. Feel free to ping me if you'd like to pick this back up @Chovin! |
closes #223