update eslint, use babel-eslint, eslint-plugin-react, fixes#1370
update eslint, use babel-eslint, eslint-plugin-react, fixes#1370hzoo wants to merge 1 commit intofacebook:masterfrom hzoo:update-eslint
Conversation
.eslintrc
Outdated
There was a problem hiding this comment.
I should of made a comment for that sorry (or just remove it).
It's replaced with "react/jsx-uses-vars": 1, in line 54 because of issues with jsx/eslint. ESLint isn't supporting it so it's recommended to use eslint-plugin-react
ESLint supports only the JSX syntax not the semantic of react. http://eslint.org/blog/2015/03/eslint-0.17.0-released/
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
https://github.com/eslint/eslint/search?q=no-unused-vars+for+jsx&type=Issues&utf8=%E2%9C%93
There was a problem hiding this comment.
Good to know! However, it looks like this still shouldn't be disabled. The jsx-uses-vars docs say:
This rule has no effect if the no-unused-vars rule is not enabled.
There was a problem hiding this comment.
Ah ok - good to know xd - will add it back. Probably need to use these rules at some point instead of just recommending it.
|
And from Travis - not sure what can be done about this? /Users/travis/build/facebook/react-native/node_modules/jstransform/node_modules/commoner/test/source/widget/share.js: WidgetShare
Duplicate module provider
/Users/travis/build/facebook/react-native/node_modules/babel-eslint/node_modules/babel-core/node_modules/regenerator/node_modules/commoner/test/source/widget/share.js: |
|
Yup :) I've integrated the .eslintrc & package.json parts of it into a commit internally (in conjunction with #259). This will be synced up here soon. I'm going to hold off on the lint fixes for now -- the extra arguments to functions are good for documentation (how will this function be called) even if they aren't used, and I think the convention is to double-quote jsx params Thanks for the work! |
|
Ah ok! |
|
the packager now uses babel and the linter uses babel-eslint. is there anything else that needs to be done with this? |
|
No this just fixed a few of the lint errors but that can be done seperately - will close. |
While working on babel/babel-eslint#108, @wincent mentioned I could check out react-native for examples of flow type usage.
In order to test I updated eslint": "0.21.2", fix deprecated rules, add config to support es6/jsx/react, add babel-eslint. I figured I could do a PR with some fixes (mostly unused parameters, quotes, semicolons etc) to see if it's wanted?
You should be able to then use
"lint": "./node_modules/.bin/eslint Examples Libraries"(I didn't fix anything in Libraries yet)