You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The name argument in AstPath#match() seems work different than AstPath#each()/AstPath#map(). It is the key to access child, not the key to access node.
This confusing me, I hope we can change it.
Make name as the key to access node to consist with other method/getter.
I don't feel strongly about 1. But 2 looks strange. The idea of match is that there is a separate predicate for each level of the AST. Why mix levels in one predicate?
The
name
argument inAstPath#match()
seems work different thanAstPath#each()
/AstPath#map()
. It is the key to access child, not the key to access node.This confusing me, I hope we can change it.
name
as the key to access node to consist with other method/getter.parent
argument.Take this as example,
https://github.com/prettier/prettier/blob/next/src/language-js/print/misc.js#L26-L30
If we choose 1:
If we choose 2:
I prefer 2nd choice.
WDYT? @thorn0
The text was updated successfully, but these errors were encountered: