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
Framework: Refine ESLint configuration #6294
Conversation
@aduth Can we combine the 2 messages? I tried to commit the change but ran into following errors.
|
@enejb Looks like error might be caused by outdated dependencies after our recent upgrades (#6116, #6090). Can you try running
|
Or, might just be that you switched from a branch where the older version of ESLint was installed, in which case a simple |
|
I cast a +1 vote here :) Also I'd be fairly on board on all the controversial ones. |
I am very much in favor of all of the listed rules. Voted on first comment via emoticon. |
The changes here look good to me, but they do introduce a bunch of new warnings (11466 in master; 17927 on this branch). It would be good to have some follow-up PRs to clean up existing lint violations. |
+1 to all changes. I'm also fine with adding the controversial ones ;) |
6c28109
to
d34b2a0
Compare
Thanks all for taking a look. There's a handful of follow-up tasks here so I'll try to tackle them soon or, more likely, create issues so they're at least tracked. |
This pull request seeks to reconcile our ESLint configuration to make use of new rules and new options for existing rules. None of these changes are meant to be controversial (though I was tempted to raise a few 😄 ). The configuration file was also sorted, so I've included a detailed list of changes and reasoning below:
comma-style
(2)constructor-super
(2)super
call in ES6 class constructorcurly
(1)max-len
(1)no-const-assign
(2)const
variablesno-console
(1)console
no-debugger
(2)debugger;
no-dupe-args
(2)no-duplicate-case
(2)case
in aswitch
with the same nameno-negated-in-lhs
(2)!
(not) in the left hand of anin
expression without parantheses!
is evaluated, i.e. cast to boolean, beforein
check)no-unreachable
(1)break;
following areturn
in aswitch
)react/no-is-mounted
(1)this.isMounted()
in a React componentspace-unary-ops
(1)!!
,++
,--
no-empty
(2)catch
Possible rules to consider as separate pull requests that I was concerned may be too controversial:
React.createClass
propTypes
for React componentsAnd another that's not yet available, but we should keep our eyes on, is
react/unused-prop-types
.