-
Notifications
You must be signed in to change notification settings - Fork 801
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
(wip) added eslint #280
(wip) added eslint #280
Conversation
}, | ||
"rules": { | ||
"no-underscore-dangle": ["error", { "allow": ["__REACT_HOT_LOADER__"] }], | ||
"jsx-quotes": ["error", "prefer-single"] |
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.
I’m fine with using double quotes everywhere. (for 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.
using double quotes for jsx and single quotes for everything else isn't weird?
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.
It’s weird but apparently it’s what everyone else is doing these days 😄
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.
double quotes it is then 😄
Looks good. I left a few comments. |
Yeah --fix helps at least with the semicolons, adding semicolons in hundreds of lines manually would have been terrible |
@gaearon you wrote some of the files without |
If we use ES modules everywhere, we should add the commonjs compat plugin so that |
add the plugin to babel? |
Yeah, this one: https://www.npmjs.com/package/babel-plugin-add-module-exports. Not sure if it works well though. Never tried it. |
hmm, not worth it then I think. basically I'm getting a bunch of |
I’m a bit confused. I meant that we can use ES modules everywhere in the code. We just need to make sure that the CommonJS compat code is generated as part of Babel compilation for entry points like |
what i'm saying is that it currently works great the way it's written so instead of changing everything to es6 modules just to appease eslint it's easier to selectively disable the offending rule, no? |
0282793
to
053157a
Compare
Works for me 👍 |
Alright, I've finished fixing all the linting errors. Give it a look if you want, I think/hope I didn't break anything. Let's merge this soon to avoid merge conflicts |
if (React.Children.count(props.children) !== 1) { | ||
return new Error(`Invalid prop "children" supplied to AppContainer. Expected a single React element with your app’s root component, e.g. <App />.`); | ||
return new Error('Invalid prop "children" supplied to AppContainer.' + |
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.
There’s a missing space after the period in the error message. The sentences will collide.
Also a style nit: let’s put a newline right after the opening paren.
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.
Good catch
The error message needs to be fixed but the rest is up to your judgement. |
@gaearon want to review the config?
I still need to fix most of the files to conform to the config
closes #274