moroshko / react-scanner

Extract React components and props usage from code.
MIT License
563 stars 40 forks source link

Feature Request: Make parsing failures more verbose #52

Open lmosele opened 1 year ago

lmosele commented 1 year ago

https://github.com/moroshko/react-scanner/blob/92b2d88b04fe5cf7f077ae518e65fd591ad935e3/src/scan.js#L109

I'm currently operating within a React/Flow codebase and am finding that everything is awesome aside from a miscelleanous series of components fail to be parsed entirely. It's not clear as to why since the error itself isnt surfaced, but I suspect it either trips up on the flow types of any extra exports within the file?

If possible I'd love to see a few more config options that specify pre-parsing rules (ie maybe a regex exclude?). Not entirely sure what the best move would be, but open to helping out if necessary!

moroshko commented 1 year ago

Flow is not supported at the moment (we only have TypeScript support). PR is welcome!