From 641732b1011a9455c70156cefb58c8c32d11feeb Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Tue, 12 Nov 2019 14:03:06 -0700 Subject: [PATCH] Upgrade typescript 3.3.3 -> 3.5.3 (#2510) * Upgrade typescript 3.3.3 -> 3.5.3 * changelog --- CHANGELOG.md | 5 ++ package.json | 8 +-- .../keyboard_accessible.test.tsx | 6 +- src/components/badge/badge.tsx | 2 +- .../notification_badge/badge_notification.tsx | 2 +- .../button/button_group/button_group.tsx | 2 +- .../button/button_toggle/button_toggle.tsx | 2 +- src/components/call_out/call_out.tsx | 2 +- src/components/color_picker/color_picker.tsx | 2 +- .../color_picker/color_picker_swatch.tsx | 2 +- src/components/color_picker/hue.tsx | 2 +- src/components/color_picker/saturation.tsx | 2 +- src/components/combo_box/combo_box.js | 3 +- src/components/combo_box/index.d.ts | 2 +- src/components/common.ts | 2 - src/components/context_menu/context_menu.tsx | 2 +- .../context_menu/context_menu_item.tsx | 2 +- .../context_menu/context_menu_panel.tsx | 2 +- src/components/control_bar/control_bar.tsx | 1 - src/components/copy/copy.tsx | 2 +- src/components/datagrid/data_grid.test.tsx | 10 +-- src/components/datagrid/data_grid.tsx | 2 +- src/components/datagrid/data_grid_cell.tsx | 2 +- .../datagrid/data_grid_header_row.tsx | 2 +- src/components/drag_and_drop/draggable.tsx | 2 +- src/components/drag_and_drop/droppable.tsx | 2 +- src/components/empty_prompt/empty_prompt.tsx | 2 +- .../form_control_layout_custom_icon.tsx | 2 +- src/components/form/radio/radio.tsx | 2 +- src/components/form/radio/radio_group.tsx | 2 +- src/components/form/range/index.d.ts | 2 +- src/components/form/range/range_slider.tsx | 8 +-- src/components/form/range/range_thumb.tsx | 2 +- src/components/form/range/range_ticks.tsx | 1 - src/components/form/super_select/index.d.ts | 2 +- src/components/form/switch/switch.tsx | 2 +- .../header/header_alert/header_alert.tsx | 2 +- src/components/health/health.tsx | 2 +- src/components/icon/icon.tsx | 2 +- src/components/inner_text/inner_text.test.tsx | 2 +- src/components/modal/index.d.ts | 2 +- src/components/overlay_mask/overlay_mask.tsx | 2 +- src/components/panel/panel.tsx | 2 +- src/components/popover/input_popover.tsx | 2 +- src/components/selectable/selectable.tsx | 2 +- .../selectable_message/selectable_message.tsx | 2 +- .../selectable_search/selectable_search.tsx | 2 +- src/components/stat/stat.tsx | 2 +- src/components/steps/steps.tsx | 2 +- src/components/steps/steps_horizontal.tsx | 2 +- src/components/text/text.tsx | 2 +- src/components/toast/toast.tsx | 2 +- src/components/tool_tip/icon_tip.tsx | 2 +- src/components/tool_tip/tool_tip_popover.tsx | 2 +- src/components/tree_view/tree_view.tsx | 6 +- yarn.lock | 69 ++++++++++--------- 56 files changed, 106 insertions(+), 103 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e3360097d1..c802d131e05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,11 @@ - Simplified `EuiColorStops` popover toggling ([#2505](https://github.com/elastic/eui/pull/2505)) +**Breaking changes** + +- Updated minimum TypeScript version to 3.5.3 ([#2510](https://github.com/elastic/eui/pull/2510)) +- Removed `Omit` type in favor of TypeScript's built-in ([#2510](https://github.com/elastic/eui/pull/2510)) + ## [`14.9.0`](https://github.com/elastic/eui/tree/v14.9.0) - Added new `euiTreeView` component for rendering recursive objects such as folder structures. ([#2409](https://github.com/elastic/eui/pull/2409)) diff --git a/package.json b/package.json index 804628edd8f..4c7fb53e23d 100644 --- a/package.json +++ b/package.json @@ -88,8 +88,8 @@ "@types/resize-observer-browser": "^0.1.1", "@types/tabbable": "^3.1.0", "@types/uuid": "^3.4.4", - "@typescript-eslint/eslint-plugin": "^1.9.0", - "@typescript-eslint/parser": "^1.9.0", + "@typescript-eslint/eslint-plugin": "^1.13.0", + "@typescript-eslint/parser": "^1.13.0", "autoprefixer": "^7.1.5", "babel-core": "7.0.0-bridge.0", "babel-eslint": "^10.0.1", @@ -175,7 +175,7 @@ "sinon": "^4.4.8", "start-server-and-test": "^1.1.4", "style-loader": "^0.19.0", - "typescript": "^3.3.3", + "typescript": "3.5.3", "uglifyjs-webpack-plugin": "^2.0.1", "url-loader": "^1.0.1", "wdio-chromedriver-service": "^0.1.2", @@ -199,6 +199,6 @@ "prop-types": "^15.5.0", "react": "^16.8", "react-dom": "^16.8", - "typescript": "^3.3.3" + "typescript": "^3.5.3" } } diff --git a/src/components/accessibility/keyboard_accessible.test.tsx b/src/components/accessibility/keyboard_accessible.test.tsx index 6c8b7f585c7..8b622ef6c96 100644 --- a/src/components/accessibility/keyboard_accessible.test.tsx +++ b/src/components/accessibility/keyboard_accessible.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable jsx-a11y/tabindex-no-positive */ import React from 'react'; import { render, shallow } from 'enzyme'; @@ -145,10 +146,7 @@ describe('EuiKeyboardAccessible', () => { test('tabindex', () => { const $button = render( -
+
); diff --git a/src/components/badge/badge.tsx b/src/components/badge/badge.tsx index 87b79f97728..dc51f9d4a22 100644 --- a/src/components/badge/badge.tsx +++ b/src/components/badge/badge.tsx @@ -5,7 +5,7 @@ import React, { ReactNode, } from 'react'; import classNames from 'classnames'; -import { CommonProps, ExclusiveUnion, keysOf, PropsOf, Omit } from '../common'; +import { CommonProps, ExclusiveUnion, keysOf, PropsOf } from '../common'; import { isColorDark, hexToRgb } from '../../services/color'; import { EuiInnerText } from '../inner_text'; diff --git a/src/components/badge/notification_badge/badge_notification.tsx b/src/components/badge/notification_badge/badge_notification.tsx index b05f5851597..fcd878aad78 100644 --- a/src/components/badge/notification_badge/badge_notification.tsx +++ b/src/components/badge/notification_badge/badge_notification.tsx @@ -1,6 +1,6 @@ import React, { HTMLAttributes, ReactNode, FunctionComponent } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit, keysOf } from '../../common'; +import { CommonProps, keysOf } from '../../common'; const colorToClassMap: { [color: string]: string | null } = { accent: null, diff --git a/src/components/button/button_group/button_group.tsx b/src/components/button/button_group/button_group.tsx index 6a11e14c034..1b7343a8ff4 100644 --- a/src/components/button/button_group/button_group.tsx +++ b/src/components/button/button_group/button_group.tsx @@ -5,7 +5,7 @@ import { EuiScreenReaderOnly } from '../../accessibility'; import { ToggleType } from '../../toggle'; import { EuiButtonToggle } from '../button_toggle'; -import { Omit, CommonProps } from '../../common'; +import { CommonProps } from '../../common'; import { ButtonColor, ButtonIconSide } from '../button'; import { IconType } from '../../icon'; diff --git a/src/components/button/button_toggle/button_toggle.tsx b/src/components/button/button_toggle/button_toggle.tsx index 0132bd3eebf..f67cd3ee090 100644 --- a/src/components/button/button_toggle/button_toggle.tsx +++ b/src/components/button/button_toggle/button_toggle.tsx @@ -8,7 +8,7 @@ import React, { } from 'react'; import classNames from 'classnames'; -import { ExclusiveUnion, Omit } from '../../common'; +import { ExclusiveUnion } from '../../common'; import { EuiToggle, ToggleType } from '../../toggle'; import { EuiButton, EuiButtonProps } from '../button'; import { useRenderToText } from '../../inner_text/render_to_text'; diff --git a/src/components/call_out/call_out.tsx b/src/components/call_out/call_out.tsx index 5dce716fd7d..3200992084d 100644 --- a/src/components/call_out/call_out.tsx +++ b/src/components/call_out/call_out.tsx @@ -2,7 +2,7 @@ import React, { FunctionComponent, HTMLAttributes, ReactNode } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit, keysOf } from '../common'; +import { CommonProps, keysOf } from '../common'; import { IconType, EuiIcon } from '../icon'; import { EuiText } from '../text'; diff --git a/src/components/color_picker/color_picker.tsx b/src/components/color_picker/color_picker.tsx index 070f9262057..d0d3fb0dc28 100644 --- a/src/components/color_picker/color_picker.tsx +++ b/src/components/color_picker/color_picker.tsx @@ -10,7 +10,7 @@ import React, { } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiScreenReaderOnly } from '../accessibility'; import { EuiColorPickerSwatch } from './color_picker_swatch'; diff --git a/src/components/color_picker/color_picker_swatch.tsx b/src/components/color_picker/color_picker_swatch.tsx index 9b53b8a3254..85f3a8f60f5 100644 --- a/src/components/color_picker/color_picker_swatch.tsx +++ b/src/components/color_picker/color_picker_swatch.tsx @@ -1,7 +1,7 @@ import React, { ButtonHTMLAttributes, forwardRef } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; export type EuiColorPickerSwatchProps = CommonProps & Omit, 'color'> & { diff --git a/src/components/color_picker/hue.tsx b/src/components/color_picker/hue.tsx index d56cfc1c4ee..93b5a9ad2d1 100644 --- a/src/components/color_picker/hue.tsx +++ b/src/components/color_picker/hue.tsx @@ -4,7 +4,7 @@ import React, { FunctionComponent, } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiScreenReaderOnly } from '../accessibility'; import { EuiI18n } from '../i18n'; diff --git a/src/components/color_picker/saturation.tsx b/src/components/color_picker/saturation.tsx index 1bff224ee7d..fcb65f594ef 100644 --- a/src/components/color_picker/saturation.tsx +++ b/src/components/color_picker/saturation.tsx @@ -8,7 +8,7 @@ import React, { } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { keyCodes } from '../../services'; import { HSV } from '../../services/color'; import { isNil } from '../../services/predicate'; diff --git a/src/components/combo_box/combo_box.js b/src/components/combo_box/combo_box.js index ae960c0cf39..08f8254a69d 100644 --- a/src/components/combo_box/combo_box.js +++ b/src/components/combo_box/combo_box.js @@ -2,6 +2,7 @@ * Elements within EuiComboBox which would normally be tabbable (inputs, buttons) have been removed * from the tab order with tabindex="-1" so that we can control the keyboard navigation interface. */ +/* eslint-disable jsx-a11y/role-has-required-aria-props */ import React, { Component } from 'react'; import PropTypes from 'prop-types'; @@ -745,7 +746,7 @@ export class EuiComboBox extends Component { onKeyDown={this.onKeyDown} ref={this.comboBoxRef} data-test-subj={dataTestSubj} - role="combobox" // eslint-disable-line jsx-a11y/role-has-required-aria-props + role="combobox" aria-haspopup="listbox" aria-expanded={isListOpen}> = ( // utility types: -export type Omit = Pick>; - /** * Wraps Object.keys with proper typescript definition of the resulting array */ diff --git a/src/components/context_menu/context_menu.tsx b/src/components/context_menu/context_menu.tsx index aa23f9958e2..f333533321d 100644 --- a/src/components/context_menu/context_menu.tsx +++ b/src/components/context_menu/context_menu.tsx @@ -6,7 +6,7 @@ import React, { } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiContextMenuPanel, EuiContextMenuPanelTransitionDirection, diff --git a/src/components/context_menu/context_menu_item.tsx b/src/components/context_menu/context_menu_item.tsx index 63a4023180f..f9746e01d3a 100644 --- a/src/components/context_menu/context_menu_item.tsx +++ b/src/components/context_menu/context_menu_item.tsx @@ -9,7 +9,7 @@ import React, { } from 'react'; import classNames from 'classnames'; -import { CommonProps, keysOf, Omit } from '../common'; +import { CommonProps, keysOf } from '../common'; import { EuiIcon } from '../icon'; import { EuiToolTip, ToolTipPositions } from '../tool_tip'; diff --git a/src/components/context_menu/context_menu_panel.tsx b/src/components/context_menu/context_menu_panel.tsx index 0354c867394..df139b40a18 100644 --- a/src/components/context_menu/context_menu_panel.tsx +++ b/src/components/context_menu/context_menu_panel.tsx @@ -8,7 +8,7 @@ import React, { import classNames from 'classnames'; import tabbable from 'tabbable'; -import { CommonProps, NoArgCallback, Omit } from '../common'; +import { CommonProps, NoArgCallback } from '../common'; import { EuiIcon } from '../icon'; import { EuiPopoverTitle } from '../popover'; import { EuiResizeObserver } from '../observer/resize_observer'; diff --git a/src/components/control_bar/control_bar.tsx b/src/components/control_bar/control_bar.tsx index cb68ef08755..61c245c8805 100644 --- a/src/components/control_bar/control_bar.tsx +++ b/src/components/control_bar/control_bar.tsx @@ -8,7 +8,6 @@ import classNames from 'classnames'; import { CommonProps, ExclusiveUnion, - Omit, PropsForAnchor, PropsForButton, } from '../common'; diff --git a/src/components/copy/copy.tsx b/src/components/copy/copy.tsx index 55fd219d4e4..53d1ef42df8 100644 --- a/src/components/copy/copy.tsx +++ b/src/components/copy/copy.tsx @@ -1,5 +1,5 @@ import React, { ReactElement, ReactNode } from 'react'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { copyToClipboard } from '../../services'; import { EuiToolTip, EuiToolTipProps } from '../tool_tip'; diff --git a/src/components/datagrid/data_grid.test.tsx b/src/components/datagrid/data_grid.test.tsx index 1ba89676cac..7665ad560c4 100644 --- a/src/components/datagrid/data_grid.test.tsx +++ b/src/components/datagrid/data_grid.test.tsx @@ -210,11 +210,11 @@ function sortByColumn( ); expect(sortButton.length).toBe(1); act(() => - // @ts-ignore-next-line - sortButton - .parents('EuiButtonGroup') - .props() - .onChange(undefined, direction) + sortButton.parents('EuiButtonGroup').props().onChange!( + undefined, + // @ts-ignore TS wants to use react's onChange definition instead of the EuiButtonGroup one + direction + ) ); } diff --git a/src/components/datagrid/data_grid.tsx b/src/components/datagrid/data_grid.tsx index 46560279bb1..066e2162f2c 100644 --- a/src/components/datagrid/data_grid.tsx +++ b/src/components/datagrid/data_grid.tsx @@ -13,7 +13,7 @@ import classNames from 'classnames'; import tabbable from 'tabbable'; import { EuiI18n } from '../i18n'; import { EuiDataGridHeaderRow } from './data_grid_header_row'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiDataGridColumn, EuiDataGridColumnWidths, diff --git a/src/components/datagrid/data_grid_cell.tsx b/src/components/datagrid/data_grid_cell.tsx index 904bb38ecdb..3d157d5fe03 100644 --- a/src/components/datagrid/data_grid_cell.tsx +++ b/src/components/datagrid/data_grid_cell.tsx @@ -12,7 +12,7 @@ import React, { import classNames from 'classnames'; import tabbable from 'tabbable'; import { EuiPopover } from '../popover'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiScreenReaderOnly } from '../accessibility'; import { EuiI18n } from '../i18n'; import { EuiButtonIcon } from '../button'; diff --git a/src/components/datagrid/data_grid_header_row.tsx b/src/components/datagrid/data_grid_header_row.tsx index db1e2650c35..a92e0aaaf35 100644 --- a/src/components/datagrid/data_grid_header_row.tsx +++ b/src/components/datagrid/data_grid_header_row.tsx @@ -13,7 +13,7 @@ import { EuiDataGridColumn, EuiDataGridSorting, } from './data_grid_types'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiDataGridColumnResizer } from './data_grid_column_resizer'; import { htmlIdGenerator } from '../../services/accessibility'; import { EuiScreenReaderOnly } from '../accessibility'; diff --git a/src/components/drag_and_drop/draggable.tsx b/src/components/drag_and_drop/draggable.tsx index 74544e25979..f57c06e56aa 100644 --- a/src/components/drag_and_drop/draggable.tsx +++ b/src/components/drag_and_drop/draggable.tsx @@ -8,7 +8,7 @@ import React, { } from 'react'; import { Draggable, DraggableProps } from 'react-beautiful-dnd'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiDroppableContext } from './droppable'; const spacingToClassNameMap = { diff --git a/src/components/drag_and_drop/droppable.tsx b/src/components/drag_and_drop/droppable.tsx index 86f47c4212f..1d27e1d67d8 100644 --- a/src/components/drag_and_drop/droppable.tsx +++ b/src/components/drag_and_drop/droppable.tsx @@ -6,7 +6,7 @@ import React, { } from 'react'; import { Droppable, DroppableProps } from 'react-beautiful-dnd'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiDragDropContextContext } from './drag_drop_context'; const spacingToClassNameMap = { diff --git a/src/components/empty_prompt/empty_prompt.tsx b/src/components/empty_prompt/empty_prompt.tsx index eaf2b6581a4..c67f1dd613f 100644 --- a/src/components/empty_prompt/empty_prompt.tsx +++ b/src/components/empty_prompt/empty_prompt.tsx @@ -7,7 +7,7 @@ import React, { } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiTitle, EuiTitleSize } from '../title/title'; import { EuiFlexGroup, EuiFlexItem } from '../flex'; import { EuiSpacer } from '../spacer'; diff --git a/src/components/form/form_control_layout/form_control_layout_custom_icon.tsx b/src/components/form/form_control_layout/form_control_layout_custom_icon.tsx index 279ba83034a..a8b5bf3bd9c 100644 --- a/src/components/form/form_control_layout/form_control_layout_custom_icon.tsx +++ b/src/components/form/form_control_layout/form_control_layout_custom_icon.tsx @@ -6,7 +6,7 @@ import React, { import classNames from 'classnames'; import { EuiIcon, IconType } from '../../icon'; -import { CommonProps, ExclusiveUnion, Omit } from '../../common'; +import { CommonProps, ExclusiveUnion } from '../../common'; export type EuiFormControlLayoutCustomIconProps = CommonProps & ExclusiveUnion< diff --git a/src/components/form/radio/radio.tsx b/src/components/form/radio/radio.tsx index e4dd1ef95ba..27a3cbe7720 100644 --- a/src/components/form/radio/radio.tsx +++ b/src/components/form/radio/radio.tsx @@ -5,7 +5,7 @@ import React, { ReactNode, } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../../common'; +import { CommonProps } from '../../common'; export interface RadioProps { autoFocus?: boolean; diff --git a/src/components/form/radio/radio_group.tsx b/src/components/form/radio/radio_group.tsx index ec6dda906c0..f6ef04aa202 100644 --- a/src/components/form/radio/radio_group.tsx +++ b/src/components/form/radio/radio_group.tsx @@ -1,5 +1,5 @@ import React, { FunctionComponent, HTMLAttributes } from 'react'; -import { CommonProps, Omit } from '../../common'; +import { CommonProps } from '../../common'; import { EuiRadio, RadioProps } from './radio'; diff --git a/src/components/form/range/index.d.ts b/src/components/form/range/index.d.ts index 853be8b80ba..ede0fe33566 100644 --- a/src/components/form/range/index.d.ts +++ b/src/components/form/range/index.d.ts @@ -1,4 +1,4 @@ -import { CommonProps, Omit } from '../../common'; +import { CommonProps } from '../../common'; import { ReactNode, FunctionComponent, InputHTMLAttributes } from 'react'; diff --git a/src/components/form/range/range_slider.tsx b/src/components/form/range/range_slider.tsx index 4c16e277000..bc536b86354 100644 --- a/src/components/form/range/range_slider.tsx +++ b/src/components/form/range/range_slider.tsx @@ -1,8 +1,6 @@ import React, { ChangeEventHandler, - FunctionComponent, InputHTMLAttributes, - Ref, forwardRef, } from 'react'; import classNames from 'classnames'; @@ -25,9 +23,7 @@ export type EuiRangeSliderProps = InputHTMLAttributes & onChange?: ChangeEventHandler; }; -export const EuiRangeSlider: FunctionComponent< - EuiRangeSliderProps -> = forwardRef( +export const EuiRangeSlider = forwardRef( ( { className, @@ -47,7 +43,7 @@ export const EuiRangeSlider: FunctionComponent< compressed, ...rest }, - ref: Ref + ref ) => { const classes = classNames( 'euiRangeSlider', diff --git a/src/components/form/range/range_thumb.tsx b/src/components/form/range/range_thumb.tsx index bd032725e79..c7d37f943df 100644 --- a/src/components/form/range/range_thumb.tsx +++ b/src/components/form/range/range_thumb.tsx @@ -1,7 +1,7 @@ import React, { FunctionComponent, HTMLAttributes } from 'react'; import classNames from 'classnames'; -import { CommonProps, ExclusiveUnion, Omit } from '../../common'; +import { CommonProps, ExclusiveUnion } from '../../common'; interface BaseProps extends CommonProps { min: number; diff --git a/src/components/form/range/range_ticks.tsx b/src/components/form/range/range_ticks.tsx index d8d63ffc322..3c42b5de44f 100644 --- a/src/components/form/range/range_ticks.tsx +++ b/src/components/form/range/range_ticks.tsx @@ -7,7 +7,6 @@ import React, { import classNames from 'classnames'; import find from 'lodash/find'; -import { Omit } from '../../common'; import { useInnerText } from '../../inner_text'; export interface EuiRangeTick { diff --git a/src/components/form/super_select/index.d.ts b/src/components/form/super_select/index.d.ts index a161f69d606..87d75033743 100644 --- a/src/components/form/super_select/index.d.ts +++ b/src/components/form/super_select/index.d.ts @@ -1,4 +1,4 @@ -import { CommonProps, Omit } from '../../common'; +import { CommonProps } from '../../common'; import { FunctionComponent, ReactNode, ButtonHTMLAttributes } from 'react'; diff --git a/src/components/form/switch/switch.tsx b/src/components/form/switch/switch.tsx index f1ccbb71d8e..6f1ffd854ba 100644 --- a/src/components/form/switch/switch.tsx +++ b/src/components/form/switch/switch.tsx @@ -6,7 +6,7 @@ import React, { } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../../common'; +import { CommonProps } from '../../common'; import makeId from '../../form/form_row/make_id'; import { EuiIcon } from '../../icon'; diff --git a/src/components/header/header_alert/header_alert.tsx b/src/components/header/header_alert/header_alert.tsx index 90dffc46f75..32683fb9774 100644 --- a/src/components/header/header_alert/header_alert.tsx +++ b/src/components/header/header_alert/header_alert.tsx @@ -2,7 +2,7 @@ import React, { FunctionComponent, HTMLAttributes, ReactNode } from 'react'; import classNames from 'classnames'; import { EuiButtonIcon } from '../../button'; -import { CommonProps, Omit } from '../../common'; +import { CommonProps } from '../../common'; import { EuiFlexGroup, EuiFlexItem } from '../../flex'; diff --git a/src/components/health/health.tsx b/src/components/health/health.tsx index 1c01f05eb6f..199ce5ed31c 100644 --- a/src/components/health/health.tsx +++ b/src/components/health/health.tsx @@ -1,6 +1,6 @@ import React, { FunctionComponent, HTMLAttributes } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiIcon, IconColor } from '../icon'; diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx index dae144dcd23..7e7158bf103 100644 --- a/src/components/icon/icon.tsx +++ b/src/components/icon/icon.tsx @@ -7,7 +7,7 @@ import React, { import PropTypes from 'prop-types'; import classNames from 'classnames'; -import { CommonProps, Omit, keysOf } from '../common'; +import { CommonProps, keysOf } from '../common'; // @ts-ignore-next-line // not generating typescript files or definitions for the generated JS components diff --git a/src/components/inner_text/inner_text.test.tsx b/src/components/inner_text/inner_text.test.tsx index c681b4f5e2f..8f736c41616 100644 --- a/src/components/inner_text/inner_text.test.tsx +++ b/src/components/inner_text/inner_text.test.tsx @@ -150,7 +150,7 @@ describe('EuiInnerText', () => { const fallback = 'Fallback'; const component = mount( - {({}, innerText) => ( + {(_, innerText) => ( {text} diff --git a/src/components/modal/index.d.ts b/src/components/modal/index.d.ts index 0ae027309ae..970a0f4e334 100644 --- a/src/components/modal/index.d.ts +++ b/src/components/modal/index.d.ts @@ -1,4 +1,4 @@ -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { FocusTarget } from '../focus_trap'; import { ReactNode, FunctionComponent, HTMLAttributes } from 'react'; diff --git a/src/components/overlay_mask/overlay_mask.tsx b/src/components/overlay_mask/overlay_mask.tsx index 5bb0266eed4..82d9d3cf0d1 100644 --- a/src/components/overlay_mask/overlay_mask.tsx +++ b/src/components/overlay_mask/overlay_mask.tsx @@ -6,7 +6,7 @@ import { Component, HTMLAttributes, ReactNode } from 'react'; import { createPortal } from 'react-dom'; import classNames from 'classnames'; -import { CommonProps, keysOf, Omit } from '../common'; +import { CommonProps, keysOf } from '../common'; export interface EuiOverlayMaskProps { onClick?: () => void; diff --git a/src/components/panel/panel.tsx b/src/components/panel/panel.tsx index 979de447969..563357fba44 100644 --- a/src/components/panel/panel.tsx +++ b/src/components/panel/panel.tsx @@ -7,7 +7,7 @@ import React, { } from 'react'; import classNames from 'classnames'; -import { CommonProps, ExclusiveUnion, Omit } from '../common'; +import { CommonProps, ExclusiveUnion } from '../common'; import { EuiBetaBadge } from '../badge/beta_badge'; export type PanelPaddingSize = 'none' | 's' | 'm' | 'l'; diff --git a/src/components/popover/input_popover.tsx b/src/components/popover/input_popover.tsx index a9f4f2df543..e9f5156e764 100644 --- a/src/components/popover/input_popover.tsx +++ b/src/components/popover/input_popover.tsx @@ -7,7 +7,7 @@ import React, { import classnames from 'classnames'; import tabbable from 'tabbable'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiFocusTrap } from '../focus_trap'; import { EuiPopover, EuiPopoverProps } from './popover'; import { EuiResizeObserver } from '../observer/resize_observer'; diff --git a/src/components/selectable/selectable.tsx b/src/components/selectable/selectable.tsx index 86ba38155c9..1ac954d6f6a 100644 --- a/src/components/selectable/selectable.tsx +++ b/src/components/selectable/selectable.tsx @@ -7,7 +7,7 @@ import React, { ReactElement, } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit, ExclusiveUnion } from '../common'; +import { CommonProps, ExclusiveUnion } from '../common'; import { EuiSelectableSearch } from './selectable_search'; import { EuiSelectableMessage } from './selectable_message'; import { EuiSelectableList } from './selectable_list'; diff --git a/src/components/selectable/selectable_message/selectable_message.tsx b/src/components/selectable/selectable_message/selectable_message.tsx index b6513f19cb4..51061045642 100644 --- a/src/components/selectable/selectable_message/selectable_message.tsx +++ b/src/components/selectable/selectable_message/selectable_message.tsx @@ -1,5 +1,5 @@ import React, { HTMLAttributes } from 'react'; -import { CommonProps, Omit } from '../../common'; +import { CommonProps } from '../../common'; import classNames from 'classnames'; import { EuiText } from '../../text'; diff --git a/src/components/selectable/selectable_search/selectable_search.tsx b/src/components/selectable/selectable_search/selectable_search.tsx index 08fccbf7502..06f4a08e79a 100644 --- a/src/components/selectable/selectable_search/selectable_search.tsx +++ b/src/components/selectable/selectable_search/selectable_search.tsx @@ -1,6 +1,6 @@ import React, { Component, InputHTMLAttributes } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../../common'; +import { CommonProps } from '../../common'; // @ts-ignore import { EuiFieldSearch } from '../../form/field_search'; import { getMatchingOptions } from '../matching_options'; diff --git a/src/components/stat/stat.tsx b/src/components/stat/stat.tsx index a5bf0b5cac1..4ab44894759 100644 --- a/src/components/stat/stat.tsx +++ b/src/components/stat/stat.tsx @@ -4,7 +4,7 @@ import React, { FunctionComponent, ReactNode, } from 'react'; -import { CommonProps, keysOf, Omit } from '../common'; +import { CommonProps, keysOf } from '../common'; import classNames from 'classnames'; import { EuiText } from '../text'; diff --git a/src/components/steps/steps.tsx b/src/components/steps/steps.tsx index b2d8688fb34..441433823d5 100644 --- a/src/components/steps/steps.tsx +++ b/src/components/steps/steps.tsx @@ -1,5 +1,5 @@ import React, { FunctionComponent, HTMLAttributes } from 'react'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import classNames from 'classnames'; import { StandaloneEuiStepProps, EuiStep } from './step'; diff --git a/src/components/steps/steps_horizontal.tsx b/src/components/steps/steps_horizontal.tsx index 2613f5048c8..38b5b7d963d 100644 --- a/src/components/steps/steps_horizontal.tsx +++ b/src/components/steps/steps_horizontal.tsx @@ -1,5 +1,5 @@ import React, { FunctionComponent, HTMLAttributes } from 'react'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import classNames from 'classnames'; import { EuiStepHorizontalProps, EuiStepHorizontal } from './step_horizontal'; diff --git a/src/components/text/text.tsx b/src/components/text/text.tsx index bc156523c01..8743015cac1 100644 --- a/src/components/text/text.tsx +++ b/src/components/text/text.tsx @@ -1,6 +1,6 @@ import React, { FunctionComponent, HTMLAttributes } from 'react'; import classNames from 'classnames'; -import { CommonProps, keysOf, Omit } from '../common'; +import { CommonProps, keysOf } from '../common'; import { TextColor, EuiTextColor } from './text_color'; diff --git a/src/components/toast/toast.tsx b/src/components/toast/toast.tsx index e654e3d7a5b..e857f0da702 100644 --- a/src/components/toast/toast.tsx +++ b/src/components/toast/toast.tsx @@ -6,7 +6,7 @@ import React, { } from 'react'; import classNames from 'classnames'; -import { CommonProps, keysOf, Omit } from '../common'; +import { CommonProps, keysOf } from '../common'; import { EuiScreenReaderOnly } from '../accessibility'; import { EuiI18n } from '../i18n'; diff --git a/src/components/tool_tip/icon_tip.tsx b/src/components/tool_tip/icon_tip.tsx index ded7a9d181e..ee02caaa2b0 100644 --- a/src/components/tool_tip/icon_tip.tsx +++ b/src/components/tool_tip/icon_tip.tsx @@ -1,6 +1,6 @@ import React, { FunctionComponent } from 'react'; -import { Omit, PropsOf } from '../common'; +import { PropsOf } from '../common'; import { EuiIcon, IconSize, IconType } from '../icon'; import { EuiToolTip, Props as EuiToolTipProps } from './tool_tip'; diff --git a/src/components/tool_tip/tool_tip_popover.tsx b/src/components/tool_tip/tool_tip_popover.tsx index f2d29da157d..9f0df09244a 100644 --- a/src/components/tool_tip/tool_tip_popover.tsx +++ b/src/components/tool_tip/tool_tip_popover.tsx @@ -1,6 +1,6 @@ import React, { HTMLAttributes, Component, ReactNode } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; type Props = CommonProps & Omit, 'title'> & { diff --git a/src/components/tree_view/tree_view.tsx b/src/components/tree_view/tree_view.tsx index ae3d338cc82..1880c92b304 100644 --- a/src/components/tree_view/tree_view.tsx +++ b/src/components/tree_view/tree_view.tsx @@ -1,6 +1,6 @@ import React, { Component, HTMLAttributes, createContext } from 'react'; import classNames from 'classnames'; -import { CommonProps, Omit } from '../common'; +import { CommonProps } from '../common'; import { EuiI18n } from '../i18n'; import { EuiIcon } from '../icon'; import { EuiScreenReaderOnly } from '../accessibility'; @@ -260,7 +260,9 @@ export class EuiTreeView extends Component { ariaLabel: hasAriaLabel(rest) ? rest['aria-label'] : '', }}> {(ariaLabel: string) => { - const label = hasAriaLabel(rest) + const label: + | { 'aria-label': string } + | { 'aria-labelledby': string } = hasAriaLabel(rest) ? { 'aria-label': ariaLabel, } diff --git a/yarn.lock b/yarn.lock index fbd76249217..2135abccf8b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1239,6 +1239,11 @@ "@types/cheerio" "*" "@types/react" "*" +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/jest-diff@*": version "20.0.1" resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" @@ -1251,6 +1256,11 @@ dependencies: "@types/jest-diff" "*" +"@types/json-schema@^7.0.3": + version "7.0.3" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" + integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A== + "@types/lodash@^4.14.116": version "4.14.118" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.118.tgz#247bab39bfcc6d910d4927c6e06cbc70ec376f27" @@ -1357,40 +1367,40 @@ "@types/unist" "*" "@types/vfile-message" "*" -"@typescript-eslint/eslint-plugin@^1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.9.0.tgz#29d73006811bf2563b88891ceeff1c5ea9c8d9c6" - integrity sha512-FOgfBorxjlBGpDIw+0LaZIXRX6GEEUfzj8LXwaQIUCp+gDOvkI+1WgugJ7SmWiISqK9Vj5r8S7NDKO/LB+6X9A== +"@typescript-eslint/eslint-plugin@^1.13.0": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.13.0.tgz#22fed9b16ddfeb402fd7bcde56307820f6ebc49f" + integrity sha512-WQHCozMnuNADiqMtsNzp96FNox5sOVpU8Xt4meaT4em8lOG1SrOv92/mUbEHQVh90sldKSfcOc/I0FOb/14G1g== dependencies: - "@typescript-eslint/experimental-utils" "1.9.0" - "@typescript-eslint/parser" "1.9.0" + "@typescript-eslint/experimental-utils" "1.13.0" eslint-utils "^1.3.1" functional-red-black-tree "^1.0.1" regexpp "^2.0.1" - requireindex "^1.2.0" tsutils "^3.7.0" -"@typescript-eslint/experimental-utils@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.9.0.tgz#a92777d0c92d7bc8627abd7cdb06cdbcaf2b39e8" - integrity sha512-1s2dY9XxBwtS9IlSnRIlzqILPyeMly5tz1bfAmQ84Ul687xBBve5YsH5A5EKeIcGurYYqY2w6RkHETXIwnwV0A== +"@typescript-eslint/experimental-utils@1.13.0": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.13.0.tgz#b08c60d780c0067de2fb44b04b432f540138301e" + integrity sha512-zmpS6SyqG4ZF64ffaJ6uah6tWWWgZ8m+c54XXgwFtUv0jNz8aJAVx8chMCvnk7yl6xwn8d+d96+tWp7fXzTuDg== dependencies: - "@typescript-eslint/typescript-estree" "1.9.0" + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "1.13.0" + eslint-scope "^4.0.0" -"@typescript-eslint/parser@1.9.0", "@typescript-eslint/parser@^1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.9.0.tgz#5796cbfcb9a3a5757aeb671c1ac88d7a94a95962" - integrity sha512-CWgC1XrQ34H/+LwAU7vY5xteZDkNqeAkeidEpJnJgkKu0yqQ3ZhQ7S+dI6MX4vmmM1TKRbOrKuXc6W0fIHhdbA== +"@typescript-eslint/parser@^1.13.0": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.13.0.tgz#61ac7811ea52791c47dc9fd4dd4a184fae9ac355" + integrity sha512-ITMBs52PCPgLb2nGPoeT4iU3HdQZHcPaZVw+7CsFagRJHUhyeTgorEwHXhFf3e7Evzi8oujKNpHc8TONth8AdQ== dependencies: - "@typescript-eslint/experimental-utils" "1.9.0" - "@typescript-eslint/typescript-estree" "1.9.0" - eslint-scope "^4.0.0" + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "1.13.0" + "@typescript-eslint/typescript-estree" "1.13.0" eslint-visitor-keys "^1.0.0" -"@typescript-eslint/typescript-estree@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.9.0.tgz#5d6d49be936e96fb0f859673480f89b070a5dd9b" - integrity sha512-7Eg0TEQpCkTsEwsl1lIzd6i7L3pJLQFWesV08dS87bNz0NeSjbL78gNAP1xCKaCejkds4PhpLnZkaAjx9SU8OA== +"@typescript-eslint/typescript-estree@1.13.0": + version "1.13.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.13.0.tgz#8140f17d0f60c03619798f1d628b8434913dc32e" + integrity sha512-b5rCmd2e6DCC6tCTN9GSUAuxdYwCM/k/2wdjHGrIRGPSJotWMCe/dGpi66u42bhuh8q3QBzqM4TMA1GUUCJvdw== dependencies: lodash.unescape "4.0.1" semver "5.5.0" @@ -12661,11 +12671,6 @@ require-uncached@^1.0.2: caller-path "^0.1.0" resolve-from "^1.0.0" -requireindex@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" - integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== - requires-port@1.x.x, requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -14408,10 +14413,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3.tgz#f1657fc7daa27e1a8930758ace9ae8da31403221" - integrity sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A== +typescript@3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" + integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== ua-parser-js@^0.7.18, ua-parser-js@^0.7.9: version "0.7.18"