Skip to content

Conversation

@alexeuler
Copy link
Contributor

@alexeuler alexeuler commented Dec 11, 2016

This change is Reviewable


react/jsx-filename-extension:
- 1
- extensions: [".js", ".jsx"]
Copy link
Member

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?

Copy link

@robwise robwise Dec 12, 2016

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?

Copy link
Member

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.

@justin808 justin808 merged commit 5b9fc02 into updates-from-alexey Dec 11, 2016
Copy link
Member

@justin808 justin808 left a 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
Copy link
Member

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?

Copy link
Member

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?

Copy link

@robwise robwise Dec 12, 2016

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.

Copy link
Member

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.

@robwise
Copy link

robwise commented Dec 12, 2016

@robwise are you suggesting that it's better to mark files with jsx with a .jsx extension?

@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.

@justin808
Copy link
Member

@robwise @alexfedoseev as far as I can tell, the FB examples for react and react-native don't use the jsx extension.

@robwise
Copy link

robwise commented Dec 12, 2016

@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.

justin808 added a commit that referenced this pull request Feb 2, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants