Skip to content

[canvas] remove unnecessary eslint style overrides, use curlys#27176

Merged
spalger merged 5 commits intoelastic:masterfrom
spalger:fix/canvas-eslint-style-overrides
Dec 18, 2018
Merged

[canvas] remove unnecessary eslint style overrides, use curlys#27176
spalger merged 5 commits intoelastic:masterfrom
spalger:fix/canvas-eslint-style-overrides

Conversation

@spalger
Copy link
Contributor

@spalger spalger commented Dec 13, 2018

Based partially on the changes in #27083, this PR removes the style rules that we migrated over from when canvas was its own repo. Best I can tell they are not necessary anymore as the eslint-config-prettier config has gotten a lot better at filtering out conflicting rules as implemented in the general "enable prettier" override section.

I spot checked rules like comma-dangle, no-multiple-empty-lines, wrap-iife, etc and they all seem to work as expected by some extra checks from @w33ble and @monfera would be appreciated.

My primary motivation for this change is currently in master, whenever I save a file multiple ; or brace changes are made that take multiple saves to resolve and sometimes never do. The changes in this PR bring canvas a little more inline with the rest of Kibana which makes contributing to the plugin a little more pleasant for me.

2018-12-13 15 43 42

@spalger spalger added chore Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// labels Dec 13, 2018
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@spalger spalger requested a review from a team as a code owner December 13, 2018 23:42
@w33ble
Copy link
Contributor

w33ble commented Dec 13, 2018

My primary motivation for this change is currently in master, whenever I save a file multiple ; or brace changes are made that take multiple saves to resolve and sometimes never do.

Awesome 😻! That's been really frustrating for everyone.

The output here looks consistent too, which is great! I haven't really poured over the changes here, but a quick spot check looks good. Is this meant to replace #27083 then?

@spalger
Copy link
Contributor Author

spalger commented Dec 13, 2018

Yep 👍

@w33ble
Copy link
Contributor

w33ble commented Dec 13, 2018

Cool. I'm not going to be able to get to this until Monday probably, but if @stacey-gammon and @monfera are on board, there's no need to wait for me.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, code reviewed the config changes, skimmed the other changes. did not pull down and test manually, but am assuming tests will catch any obvious errors.

'packages/kbn-test/**/*',
'packages/kbn-eslint-import-resolver-kibana/**/*',
'x-pack/plugins/apm/**/*',
'x-pack/plugins/canvas/**/*',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come things like src/* aren't in here? or other plugins like reporting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier support is opt-in, we wanted to "take it slow" which basically just meant enabling it for one piece at a time when someone wanted to go through the pain of comiting the massive autofix pr.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does opting into Prettier here make the prettier config in the Canvas overrides redundant? It would be nice if that stuff was only configured once.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, thought I removed all of that but I had left behind the plugin: ['prettier'] bit, removed it now.

plugins: ['prettier'],
rules: {
// preferences
'comma-dangle': [2, 'always-multiline'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why'd you remove the comma dangle and spacing rules? Perhaps, they're upstream rules now and so they're redundant here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, they're handled by prettier.

Copy link
Contributor

@w33ble w33ble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix output looks good. Still curious about the comma dangle and spacing rules being removed, but either way the changes here LGTM.

@spalger spalger added the review label Dec 17, 2018
@elasticmachine

This comment has been minimized.

…ents/datetime_range_absolute/datetime_range_absolute.js
@elastic elastic deleted a comment from elasticmachine Dec 17, 2018
@elasticmachine
Copy link
Contributor

💔 Build Failed

@spalger
Copy link
Contributor Author

spalger commented Dec 18, 2018

Job succeeded but asset upload failed

@spalger spalger merged commit ccfa8a3 into elastic:master Dec 18, 2018
spalger pushed a commit to spalger/kibana that referenced this pull request Dec 18, 2018
…ic#27176)

* [canvas] remove styling rules that are handled by prettier, always use curlys in if

* [eslint] autofix missing curly brackets

* [eslint/canvas] remove redundant prettier plugin config

* autofix lint errors in canvas_plugin_src/renderers/time_filter/components/datetime_range_absolute/datetime_range_absolute.js
spalger pushed a commit to spalger/kibana that referenced this pull request Dec 18, 2018
…ic#27176)

* [canvas] remove styling rules that are handled by prettier, always use curlys in if

* [eslint] autofix missing curly brackets

* [eslint/canvas] remove redundant prettier plugin config

* autofix lint errors in canvas_plugin_src/renderers/time_filter/components/datetime_range_absolute/datetime_range_absolute.js
w33ble pushed a commit that referenced this pull request Dec 18, 2018
…27176) (#27354)

Backports the following commits to 6.x:
 - [canvas] remove unnecessary eslint style overrides, use curlys  (#27176)
w33ble pushed a commit that referenced this pull request Dec 18, 2018
… (#27355)

* [canvas] remove styling rules that are handled by prettier, always use curlys in if

* [eslint] autofix missing curly brackets

* [eslint/canvas] remove redundant prettier plugin config

* autofix lint errors in canvas_plugin_src/renderers/time_filter/components/datetime_range_absolute/datetime_range_absolute.js
@spalger
Copy link
Contributor Author

spalger commented Dec 18, 2018

6.x/6.6: bd27973
6.5: 8903e36

@spalger spalger deleted the fix/canvas-eslint-style-overrides branch December 18, 2018 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v6.5.5 v6.6.0 v7.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants