Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upTypes, generics throw parsing errors #1131
Comments
feross
added
the
need more info
label
May 15, 2018
This comment has been minimized.
This comment has been minimized.
|
@pglhall The To use TypeScript with Let me know if that fixes things for you. |
This comment has been minimized.
This comment has been minimized.
|
It turns out to be Flow. I did a bit of digging through the node_modules directory to see what React Native installed out of the box, and there are several Babel modules for parsing and removing Flow syntax. I've added eslint-plugin-flowtype and configured Standard to use it, and it now parses. A bit irritated that RN likes to add this unnecessary stuff, but I'd rather keep my code in line with the syntax of their current sample code than remove it. Thanks for your help :) |
no-response
bot
removed
the
need more info
label
May 15, 2018
This comment has been minimized.
This comment has been minimized.
|
Perfect. |
pglhall commentedMay 15, 2018
Using standard 11.0.1, Node.js 9.11.1, yarn 1.6.0, macOS 10.13.4.
I'm trying to use a React Native component directly from React Native 0.55.3's boilerplate, and a very similar one of my own. I didn't expect it to pass Standard, but I was surprised that it caused parsing errors.
Here's the relevant code from the boilerplate and the code I wrote myself:
That generates the following parsing errors:
Obviously, it's not recognising either the type declaration or the generic. I think I don't mind if these are forbidden by Standard (as long as there's a sensible alternative), but the parsing errors are preventing me from using Standard across the project.
I noticed that React Native installed a bunch of babel/eslint plugins on project creation. Should I be hooking these into Standard in any way? Would it help?
Thanks :)