-
Notifications
You must be signed in to change notification settings - Fork 7
lints + flow #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lints + flow #24
Conversation
|
|
||
| react/jsx-filename-extension: | ||
| - 1 | ||
| - extensions: [".js", ".jsx"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robwise @alexfedoseev How about we put this into the shakacode linter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justin808 I commented on the styleguide repo, what's the reasoning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justin808 It should be:
react/jsx-filename-extension:
- 1
- extensions: [".js"]
# or
react/jsx-filename-extension:
- 1
- extensions: [".jsx"]
In general I'm fine w/ either, but as we already have a big codebase, that's using .jsx, I'd stay were we are as there's no reason to spend time on this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robwise are you suggesting that it's better to mark files with jsx with a .jsx extension?
| globals: | ||
| __DEV__: true | ||
| ReactClass: true | ||
| ReactElement: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robwise @alexfedoseev Should these go into the shakacode linter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it React Native specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't React-Native specific, these are used when typing React with flow. If you use eslint-plugin-flowtype, defining these as globals isn't necessary and these can be removed. I would also recommend using the recommend configuation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is crazy train, I can't find anything about ReactElement here. AFAIR I had issues w/ it and bunch of examples were using React$Element—it is in the defs, but it wasn't work either. Then I found this post, where stated that ReactElement is removed from public API and React.Element should be used instead. The funny thing is that it worked and still works, but: there is no Element property on React object lol.
@justin808 Yes that's what we've always been doing. If it has JSX in it, it's a jsx file. If it doesn't, it's a JS file. |
|
@robwise @alexfedoseev as far as I can tell, the FB examples for react and react-native don't use the jsx extension. |
|
@justin808 We shouldn't deviate from the Airbnb styleguide unless we have a good reason. We would have to change an unbelievably monstrous number of files on F&G if we implement this. It's a good rule IMO anyway. |
* V2 of the react-native client for reactrails.com * Working with Cocoapods * Updated with a fresh build of react-native * Using [email protected] * Installed the react-native-vector-icons using react-native link * Got flow and lint running 6 Flow errors in libraries. Many eslint errors * lints + flow (#24) * eslint * flow
This change is