Open Ayc0 opened 3 years ago
Experiencing the same issue in jscodeshift, and tracked it down to here as well. I'm trying to do a camel case rename, and I've got:
const p = new Promise<{ foo_bar: string }>(resolve => resolve({ foo_bar: 'baz' }))
root.find(j.Identifier)
finds the foo_bar
in the Promise function, but not the one in the type parameter.
The AST is generated with @babel/parser
(jscodeshift --parser=tsx
).
@benjamn, would you be able to help out here by any chance? Hate to @
you, but this issue is 11 months old so at this point it would appear that the issue has gone unnoticed and adding my thumbs-up alone is unlikely to help surface it :D
Same as https://github.com/benjamn/ast-types/issues/242 but for TS instead of flow.
I left this comment https://github.com/benjamn/ast-types/issues/242#issuecomment-696789947 initially. But as the issue is closed, I'm re-opening one.
I was using JSCodeShift and noticed that I couldn't select nodes in type hints:
If the input is:
I cannot find the 2 enums:
I created issue facebook/jscodeshift#389 on their repo, but I think the .traverse function comes from this lib instead, so I'm reposting here.
There is a bit more info on the initial issue in jscodeshift (like the full AST, or a code sandbox repro)