Skip to content
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

Upgrade eslint #8101

Closed
wants to merge 34 commits into from
Closed

Upgrade eslint #8101

wants to merge 34 commits into from

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Aug 26, 2016

Fixes #7609
Fixes #7622

Upgrades eslint and other related dependencies to the latest versions so that we can take advantage of some of the new auto-fixing features while making the transition to babel 6.

The commits are laid out to help the reviewer focus on a single change type at a time. commits mentioning "autofix" were done completely with npm run lintroller and do not need to be as thoroughly checked.

@spalger spalger added the review label Aug 26, 2016
@spalger
Copy link
Contributor Author

spalger commented Aug 26, 2016

The majority of the rules were fixable with eslint alone, but no-unused-vars was a bit trickier. Since we had so many violations, and I didn't want to go numb fixing them all by hand, I wrote some jscodeshift transforms to help with common scenarios: https://github.com/kreeware/kibana-jscodeshift/tree/master/transforms

@spalger spalger force-pushed the upgrade/eslint branch 8 times, most recently from 828490b to 4b43cdc Compare August 31, 2016 00:04
@cjcenizal cjcenizal self-assigned this Sep 1, 2016
'src',
'tasks',
'test',
'utilities',
Copy link
Contributor

@cjcenizal cjcenizal Sep 1, 2016

Choose a reason for hiding this comment

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

This array needs to be defined with the root and a globbing pattern for lint_staged_files.js to pick up the staged files:

    lintThese: [
      '<%= root %>/Gruntfile.js',
      '<%= root %>/bin/**/*.js',
      '<%= root %>/config/**/*.js',
      '<%= root %>/src/**/*.js',
      '<%= root %>/tasks/**/*.js',
      '<%= root %>/test/**/*.js',
      '<%= root %>/utilities/**/*.js',
    ],

Copy link
Contributor Author

@spalger spalger Sep 1, 2016

Choose a reason for hiding this comment

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

Ah, the **/*.js is necessary. Makes sense

Copy link
Contributor

Choose a reason for hiding this comment

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

We can use ** instead of the root reference, too:

    lintThese: [
      '**/Gruntfile.js',
      '**/bin/**/*.js',
      '**/config/**/*.js',
      '**/src/**/*.js',
      '**/tasks/**/*.js',
      '**/test/**/*.js',
      '**/utilities/**/*.js',
    ],

@cjcenizal
Copy link
Contributor

cjcenizal commented Sep 1, 2016

This is really awesome. I found one bug, and have a few other thoughts:

  1. Where are the eslint rule changes documented? Can we add some eslint-config-kibana 0.2.0 release notes? This way I will know what to test for.
  2. Per @thomasneirynck 's point, if you fix some linting errors but don't commit the file, then the lint task will pass and we'll end up committing files that violate our linting rules. I guess these should be caught by Jenkins, though, right? The other solution I can think of is to do some sort of check in our linting task: if a file is staged, but has unstaged changes, error out and require the user to stage the changes or unstage the file.

@spalger
Copy link
Contributor Author

spalger commented Sep 2, 2016

an we add some eslint-config-kibana 0.2.0 release notes?

Eh, there is less than a single page of commits. Release notes are probably overkill

if you fix some linting errors but don't commit the file, then the lint task will pass and we'll end up committing files that violate our linting rules

Unfortunately, preventing this would require a pretty sophisticated grunt task. This limitation has existed since the pre-commit check was introduced years ago and only comes up very rarely, so I'm not convinced it's worth the effort.

@spalger spalger force-pushed the upgrade/eslint branch 12 times, most recently from f4b5e12 to 9fb001c Compare September 7, 2016 01:17
@cjcenizal
Copy link
Contributor

LGTM

@spalger
Copy link
Contributor Author

spalger commented Dec 2, 2016

I'm going to take another stab at this in a new pr, with a basic tool to help transform files

@spalger spalger closed this Dec 2, 2016
cee-chen added a commit that referenced this pull request Oct 31, 2024
`v97.2.0`⏩`v97.3.0`

_[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_

---

## [`v97.3.0`](https://github.com/elastic/eui/releases/v97.3.0)

- `EuiDataGrid` now supports a new
`toolbarVisibility.showDisplaySelector.customRender` function that
allows completely customizing the rendering of the display selector
popover ([#8080](elastic/eui#8080))
- `EuiDataGrid`'s row height/lines per row setting has been streamlined
in both UI and UX ([#8080](elastic/eui#8080))
- `EuiDataGrid` now accepts consumer-passed display setting updates even
after users have changed their display preferences via UI
([#8080](elastic/eui#8080))
- Updated `EuiDataGrid` to vertically center all
`toolbarVisibility.additionalControls` nodes
([#8085](elastic/eui#8085))
- Updated `EuiDataGrid` with a beta
`rowHeightsOptions.autoBelowLineCount` feature flag
([#8096](elastic/eui#8096))
- Updated `EuiContextMenuPanel` to allow disabling initial focus via
`initialFocusedItemIndex={-1}`
([#8101](elastic/eui#8101))

**Bug fixes**

- Fixed `EuiComment`'s typing to correctly reflect all accepted props
([#8089](elastic/eui#8089))
- Fixed `EuiSelectableTemplateSitewide`s within dark-themed `EuiHeader`s
missing input borders
([#8100](elastic/eui#8100))
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 31, 2024
`v97.2.0`⏩`v97.3.0`

_[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_

---

## [`v97.3.0`](https://github.com/elastic/eui/releases/v97.3.0)

- `EuiDataGrid` now supports a new
`toolbarVisibility.showDisplaySelector.customRender` function that
allows completely customizing the rendering of the display selector
popover ([elastic#8080](elastic/eui#8080))
- `EuiDataGrid`'s row height/lines per row setting has been streamlined
in both UI and UX ([elastic#8080](elastic/eui#8080))
- `EuiDataGrid` now accepts consumer-passed display setting updates even
after users have changed their display preferences via UI
([elastic#8080](elastic/eui#8080))
- Updated `EuiDataGrid` to vertically center all
`toolbarVisibility.additionalControls` nodes
([elastic#8085](elastic/eui#8085))
- Updated `EuiDataGrid` with a beta
`rowHeightsOptions.autoBelowLineCount` feature flag
([elastic#8096](elastic/eui#8096))
- Updated `EuiContextMenuPanel` to allow disabling initial focus via
`initialFocusedItemIndex={-1}`
([elastic#8101](elastic/eui#8101))

**Bug fixes**

- Fixed `EuiComment`'s typing to correctly reflect all accepted props
([elastic#8089](elastic/eui#8089))
- Fixed `EuiSelectableTemplateSitewide`s within dark-themed `EuiHeader`s
missing input borders
([elastic#8100](elastic/eui#8100))

(cherry picked from commit 4e7d43a)
kibanamachine added a commit that referenced this pull request Oct 31, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [Upgrade EUI to v97.3.0
(#198087)](#198087)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Cee
Chen","email":"549407+cee-chen@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-31T02:41:45Z","message":"Upgrade
EUI to v97.3.0 (#198087)\n\n`v97.2.0`⏩`v97.3.0`\r\n\r\n_[Questions?
Please see our Kibana
upgrade\r\nFAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_\r\n\r\n---\r\n\r\n##
[`v97.3.0`](https://github.com/elastic/eui/releases/v97.3.0)\r\n\r\n-
`EuiDataGrid` now supports a
new\r\n`toolbarVisibility.showDisplaySelector.customRender` function
that\r\nallows completely customizing the rendering of the display
selector\r\npopover
([#8080](https://github.com/elastic/eui/pull/8080))\r\n- `EuiDataGrid`'s
row height/lines per row setting has been streamlined\r\nin both UI and
UX ([#8080](https://github.com/elastic/eui/pull/8080))\r\n-
`EuiDataGrid` now accepts consumer-passed display setting updates
even\r\nafter users have changed their display preferences via
UI\r\n([#8080](https://github.com/elastic/eui/pull/8080))\r\n- Updated
`EuiDataGrid` to vertically center
all\r\n`toolbarVisibility.additionalControls`
nodes\r\n([#8085](https://github.com/elastic/eui/pull/8085))\r\n-
Updated `EuiDataGrid` with a
beta\r\n`rowHeightsOptions.autoBelowLineCount` feature
flag\r\n([#8096](https://github.com/elastic/eui/pull/8096))\r\n- Updated
`EuiContextMenuPanel` to allow disabling initial focus
via\r\n`initialFocusedItemIndex={-1}`\r\n([#8101](https://github.com/elastic/eui/pull/8101))\r\n\r\n**Bug
fixes**\r\n\r\n- Fixed `EuiComment`'s typing to correctly reflect all
accepted
props\r\n([#8089](https://github.com/elastic/eui/pull/8089))\r\n- Fixed
`EuiSelectableTemplateSitewide`s within dark-themed
`EuiHeader`s\r\nmissing input
borders\r\n([#8100](https://github.com/elastic/eui/pull/8100))","sha":"4e7d43a03181ab95719733cc0a44d4896481841f","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","EUI","v9.0.0","backport:version","v8.17.0"],"title":"Upgrade
EUI to
v97.3.0","number":198087,"url":"https://github.com/elastic/kibana/pull/198087","mergeCommit":{"message":"Upgrade
EUI to v97.3.0 (#198087)\n\n`v97.2.0`⏩`v97.3.0`\r\n\r\n_[Questions?
Please see our Kibana
upgrade\r\nFAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_\r\n\r\n---\r\n\r\n##
[`v97.3.0`](https://github.com/elastic/eui/releases/v97.3.0)\r\n\r\n-
`EuiDataGrid` now supports a
new\r\n`toolbarVisibility.showDisplaySelector.customRender` function
that\r\nallows completely customizing the rendering of the display
selector\r\npopover
([#8080](https://github.com/elastic/eui/pull/8080))\r\n- `EuiDataGrid`'s
row height/lines per row setting has been streamlined\r\nin both UI and
UX ([#8080](https://github.com/elastic/eui/pull/8080))\r\n-
`EuiDataGrid` now accepts consumer-passed display setting updates
even\r\nafter users have changed their display preferences via
UI\r\n([#8080](https://github.com/elastic/eui/pull/8080))\r\n- Updated
`EuiDataGrid` to vertically center
all\r\n`toolbarVisibility.additionalControls`
nodes\r\n([#8085](https://github.com/elastic/eui/pull/8085))\r\n-
Updated `EuiDataGrid` with a
beta\r\n`rowHeightsOptions.autoBelowLineCount` feature
flag\r\n([#8096](https://github.com/elastic/eui/pull/8096))\r\n- Updated
`EuiContextMenuPanel` to allow disabling initial focus
via\r\n`initialFocusedItemIndex={-1}`\r\n([#8101](https://github.com/elastic/eui/pull/8101))\r\n\r\n**Bug
fixes**\r\n\r\n- Fixed `EuiComment`'s typing to correctly reflect all
accepted
props\r\n([#8089](https://github.com/elastic/eui/pull/8089))\r\n- Fixed
`EuiSelectableTemplateSitewide`s within dark-themed
`EuiHeader`s\r\nmissing input
borders\r\n([#8100](https://github.com/elastic/eui/pull/8100))","sha":"4e7d43a03181ab95719733cc0a44d4896481841f"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198087","number":198087,"mergeCommit":{"message":"Upgrade
EUI to v97.3.0 (#198087)\n\n`v97.2.0`⏩`v97.3.0`\r\n\r\n_[Questions?
Please see our Kibana
upgrade\r\nFAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_\r\n\r\n---\r\n\r\n##
[`v97.3.0`](https://github.com/elastic/eui/releases/v97.3.0)\r\n\r\n-
`EuiDataGrid` now supports a
new\r\n`toolbarVisibility.showDisplaySelector.customRender` function
that\r\nallows completely customizing the rendering of the display
selector\r\npopover
([#8080](https://github.com/elastic/eui/pull/8080))\r\n- `EuiDataGrid`'s
row height/lines per row setting has been streamlined\r\nin both UI and
UX ([#8080](https://github.com/elastic/eui/pull/8080))\r\n-
`EuiDataGrid` now accepts consumer-passed display setting updates
even\r\nafter users have changed their display preferences via
UI\r\n([#8080](https://github.com/elastic/eui/pull/8080))\r\n- Updated
`EuiDataGrid` to vertically center
all\r\n`toolbarVisibility.additionalControls`
nodes\r\n([#8085](https://github.com/elastic/eui/pull/8085))\r\n-
Updated `EuiDataGrid` with a
beta\r\n`rowHeightsOptions.autoBelowLineCount` feature
flag\r\n([#8096](https://github.com/elastic/eui/pull/8096))\r\n- Updated
`EuiContextMenuPanel` to allow disabling initial focus
via\r\n`initialFocusedItemIndex={-1}`\r\n([#8101](https://github.com/elastic/eui/pull/8101))\r\n\r\n**Bug
fixes**\r\n\r\n- Fixed `EuiComment`'s typing to correctly reflect all
accepted
props\r\n([#8089](https://github.com/elastic/eui/pull/8089))\r\n- Fixed
`EuiSelectableTemplateSitewide`s within dark-themed
`EuiHeader`s\r\nmissing input
borders\r\n([#8100](https://github.com/elastic/eui/pull/8100))","sha":"4e7d43a03181ab95719733cc0a44d4896481841f"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.eslintignore file is superseded by "lintThese" config var in Gruntfile ESLint should catch unused vars
3 participants