had a report of an error [1], which came down to the flow parser [2].
looks like ideally we’d use the tsx parser, which jscodeshift just abstracts over the babylon (@babel/parser) with some predefined options. [3]
the problem was that jscodeshift with the tsx parser & it’s options does not consider require as an import statement, and then most codemods become useless if you’re using requires. [4]
(there might be other draw-backs as well, just haven’t investigated deep enough).
[1] https://pipedrive.slack.com/archives/C02LK8Y583D/p1641893745002800
[2] https://pipedrive.slack.com/archives/C02LK8Y583D/p1641923713004400?thread_ts=1641893745.002800&cid=C02LK8Y583D
[3] https://github.com/facebook/jscodeshift/blob/main/parser/tsx.js
[4] https://pipedrive.slack.com/archives/C02LK8Y583D/p1641925900005500?thread_ts=1641893745.002800&cid=C02LK8Y583D