removing undefined from AstPath<PrintableNode | undefined>#1512
Conversation
dc09696 to
4ba5e73
Compare
ecb0bdc to
b815f83
Compare
…it's not required
b815f83 to
24c7625
Compare
I'm not sure I fully understand the situation, but it seems to boil down to:
So our options are to keep relying on that implicit handling or to handle it ourselves. Is that more or less correct? If so: I wouldn't do anything. For this to be a problem, several things have to happen (prettier core makes what amounts to a breaking change, our own quite strict typescript usage passes an undefined, etc.), and if it does happen it's probably going to be loud and easy to figure out and handle. |
|
yeah yeah, I agree, one good thing came out of this. I had to rethink how much we depended on this and noticed #1518 was a good thing to change. |
since it's not required with our current print strategy.
as a bonus I added
getVisitorKeysto minimise the visits to nodes prettier will make during their process. (there is a small bump in the speed of our tests)Also @fvictorio what's your input on prettier/prettier#19041 (comment)? I'm inclined in keeping our printing approach as is and only address it if in a future version, prettier decides to do something different when passing
undefinedlike throwing.