-
Notifications
You must be signed in to change notification settings - Fork 712
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
Update to newer eslint #3643
Update to newer eslint #3643
Conversation
This might help if we wanna keep scope fresh w/ latest eslint. Otherwise we could disable those rules.. https://github.com/thibaudcolas/react-destructuring-assignment-codemod/blob/master/README.md |
@fbarl what do you think? |
Some icky cases for us:
handleMouseEnter(ev) {
- this.props.enterEdge(decodeIdAttribute(ev.currentTarget.id));
+ const { enterEdge } = this.props;
+ enterEdge(decodeIdAttribute(ev.currentTarget.id));
} I think disabling is okay really. |
as per discussion in #3643 (comment)
The new list of lint problems is:
|
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 added some more comments to the PR.
Good job so far on reducing the list of errors - at some point soon I think it would be best to start addressing them manually!
</i> | ||
) |
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.
A lot of this autofixed HTML content has very weird indentation now - I wonder if there's a nicer way to represent it that is still acceptable for the linter..
return BLURRED_EDGES_LAYER; | ||
} else if (edge.get('highlighted')) { | ||
} if (edge.get('highlighted')) { |
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 personally find this rule rather confusing (if
being the same as else if
only because of the return statements feels like an extra cognitive load), but I think I'd be able to live with it :)
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'd put the if
on the next line.
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 was done by eslint
using the --fix
option.
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 was basically ef44eb3 - let me know if you'd prefer me to revert this and we either
- figure out if we want to fix our code to comply with new
eslint
rules - or ignore some of those new rules
@@ -31,6 +31,7 @@ | |||
"no-param-reassign": 0, | |||
"no-restricted-properties": 0, | |||
"object-curly-spacing": 0, | |||
"react/destructuring-assignment": 0, |
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.
👍
@fbarl and @foot Thanks for the reviews so far. I set up this Draft PR, so we can collectively fix this. I want to get the security issues resolved, but I won't have time to dive deep enough into this to actually have an opinion on JavaScript indentation. This is what I could fix easily. The rest will have to be done by somebody else If fear. |
feaca43
to
39c5535
Compare
as per discussion in #3643 (comment)
Almost there:
|
…by using unreleased eslint-loader (waiting for release)
as per discussion in #3643 (comment)
618cc73
to
2ab7ada
Compare
|
I just addressed all the remaining I'd suggest to test only the behavior when reviewing this PR as the code change mostly consists of functions that moved around. |
Ready for review now. |
478e325
to
a700530
Compare
as per discussion in #3643 (comment)
Since @fbarl and I worked on this, we both tested it and the warnings in the browser console look OK, we'll go ahead and merge it. |
I started work on updating
eslint
for a security update. Some issues I was able to resolve by runningeslint --fix
, these still need work and I'd need help: