-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[eslint-config-kibana] Upgrade eslint-config to 0.10.0. #13323
[eslint-config-kibana] Upgrade eslint-config to 0.10.0. #13323
Conversation
import AggSelect from './agg_select'; | ||
import AggRow from './agg_row'; | ||
import createChangeHandler from '../lib/create_change_handler'; | ||
import createSelectHandler from '../lib/create_select_handler'; | ||
import createTextHandler from '../lib/create_text_handler'; | ||
|
||
class FilterRatioAgg extends Component { | ||
export const Static = props => { |
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 renamed this component because I think the original name was a typo.
import AggSelect from './agg_select'; | ||
import MetricSelect from './metric_select'; | ||
import AggRow from './agg_row'; | ||
import createChangeHandler from '../lib/create_change_handler'; | ||
import createSelectHandler from '../lib/create_select_handler'; | ||
import createTextHandler from '../lib/create_text_handler'; | ||
|
||
class DerivativeAgg extends Component { |
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.
Changing these components from classes to function makes a lot more changed lines than necessary. Is this a requirement of the new eslint rules? Is it autofixable? If there are auto-fixed changes and manual changes, it would be great if they were in separate commits so they could be reviewed with different scrutiny.
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.
If the class -> function conversion isn't necessary, I'd be fine with it still but another separate commit would be very helpful.
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.
Preferring stateless functional components is one of the rules I added, but no it isn't autofixable unfortunately. It also means moving a lot of default exports to named exports (which is also part of our style guide, I believe). I broke this PR up into 2 commits (automatic fixes and manual ones), for your convenience.
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.
Awesome, thanks!
2e1ad7e
to
e422a3b
Compare
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.
LGTM
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.
PR's like this are practically un-review-able and quite frankly pretty risky based on the size alone. I would rather see you create 11 PR's for each new rule and the corresponding refactor then one massive PR like this. Another approach would be to try and isolate the reactor to logical components so they are not all jumbled up into one gigantic PR.
I reviewed this to the best of my abilities... reviewed the code and tested (manually) all the aggs that where refactored) LGETM |
Thanks @simianhacker ! |
e422a3b
to
6a842f5
Compare
* Upgrade eslint-config to 0.10.0. * Fix linting violations with popover and typography stuff in UI Framework.
@simianhacker Would you mind going through the TSVB UI and making sure I haven't broken anything? I had to change a bunch of components to named exports, and I'm not sure I updated all of the import call sites to match.