diff --git a/src-docs/src/views/search_bar/search_bar.js b/src-docs/src/views/search_bar/search_bar.js
index 0e4d1accd4e..cdecb522154 100644
--- a/src-docs/src/views/search_bar/search_bar.js
+++ b/src-docs/src/views/search_bar/search_bar.js
@@ -28,13 +28,13 @@ const types = ['dashboard', 'visualization', 'watch'];
const users = ['dewey', 'wanda', 'carrie', 'jmack', 'gabic'];
-const items = times(10, id => {
+const items = times(10, (id) => {
return {
id,
status: random.oneOf(['open', 'closed']),
type: random.oneOf(types),
tag: random.setOf(
- tags.map(tag => tag.name),
+ tags.map((tag) => tag.name),
{ min: 0, max: 3 }
),
active: random.boolean(),
@@ -46,10 +46,10 @@ const items = times(10, id => {
});
const loadTags = () => {
- return new Promise(resolve => {
+ return new Promise((resolve) => {
setTimeout(() => {
resolve(
- tags.map(tag => ({
+ tags.map((tag) => ({
value: tag.name,
view:
,
}))
@@ -153,11 +153,11 @@ export const SearchBar = () => {
},
tag: {
type: 'string',
- validate: value => {
- if (value !== '' && !tags.some(tag => tag.name === value)) {
+ validate: (value) => {
+ if (value !== '' && !tags.some((tag) => tag.name === value)) {
throw new Error(
`unknown tag (possible values: ${tags
- .map(tag => tag.name)
+ .map((tag) => tag.name)
.join(',')})`
);
}
@@ -205,7 +205,7 @@ export const SearchBar = () => {
{
name: 'Open',
field: 'status',
- render: status => (status === 'open' ? 'Yes' : 'No'),
+ render: (status) => (status === 'open' ? 'Yes' : 'No'),
},
{
name: 'Active',
@@ -223,7 +223,7 @@ export const SearchBar = () => {
{
name: 'Stats',
width: '150px',
- render: item => {
+ render: (item) => {
return (
{`${item.stars} Stars`}
diff --git a/src-docs/src/views/search_bar/search_bar_filters.js b/src-docs/src/views/search_bar/search_bar_filters.js
index 4c4ef026605..d32bd020cfc 100644
--- a/src-docs/src/views/search_bar/search_bar_filters.js
+++ b/src-docs/src/views/search_bar/search_bar_filters.js
@@ -43,13 +43,13 @@ const types = ['dashboard', 'visualization', 'watch'];
const users = ['dewey', 'wanda', 'carrie', 'jmack', 'gabic'];
-const items = times(10, id => {
+const items = times(10, (id) => {
return {
id,
status: random.oneOf(['open', 'closed']),
type: random.oneOf(types),
tag: random.setOf(
- tags.map(tag => tag.name),
+ tags.map((tag) => tag.name),
{ min: 0, max: 3 }
),
active: random.boolean(),
@@ -82,7 +82,7 @@ export const SearchBarFilters = () => {
field: 'tag',
name: 'Tag ("prefix" filter, default)',
multiSelect: 'or',
- options: tags.map(tag => ({
+ options: tags.map((tag) => ({
value: tag.name,
view:
{tag.name},
})),
@@ -93,7 +93,7 @@ export const SearchBarFilters = () => {
name: 'Tag ("includes" filter)',
filterWith: 'includes',
multiSelect: 'or',
- options: tags.map(tag => ({
+ options: tags.map((tag) => ({
value: tag.name,
view:
{tag.name},
})),
@@ -104,7 +104,7 @@ export const SearchBarFilters = () => {
name: 'Tag (custom filter)',
filterWith: () => Math.random() > 0.5,
multiSelect: 'or',
- options: tags.map(tag => ({
+ options: tags.map((tag) => ({
value: tag.name,
view:
{tag.name},
})),
@@ -140,11 +140,11 @@ export const SearchBarFilters = () => {
},
tag: {
type: 'string',
- validate: value => {
- if (!tags.some(tag => tag.name === value)) {
+ validate: (value) => {
+ if (!tags.some((tag) => tag.name === value)) {
throw new Error(
`unknown tag (possible values: ${tags
- .map(tag => tag.name)
+ .map((tag) => tag.name)
.join(',')})`
);
}
@@ -192,7 +192,7 @@ export const SearchBarFilters = () => {
{
name: 'Open',
field: 'status',
- render: status => (status === 'open' ? 'Yes' : 'No'),
+ render: (status) => (status === 'open' ? 'Yes' : 'No'),
},
{
name: 'Active',
@@ -210,7 +210,7 @@ export const SearchBarFilters = () => {
{
name: 'Stats',
width: '150px',
- render: item => {
+ render: (item) => {
return (
{`${item.stars} Stars`}
diff --git a/src-docs/src/views/selectable/search.tsx b/src-docs/src/views/selectable/search.tsx
index dee0ea73792..d1a497a80ea 100644
--- a/src-docs/src/views/selectable/search.tsx
+++ b/src-docs/src/views/selectable/search.tsx
@@ -32,7 +32,7 @@ export default () => {
*/
const recents = searchData.slice(0, 5);
const recentsWithIcon: EuiSelectableTemplateSitewideOption[] = recents.map(
- recent => {
+ (recent) => {
return {
...recent,
icon: {
@@ -74,7 +74,9 @@ export default () => {
* Do something with the selection based on the found option with `checked: on`
*/
const onChange = (updatedOptions: EuiSelectableTemplateSitewideOption[]) => {
- const clickedItem = updatedOptions.find(option => option.checked === 'on');
+ const clickedItem = updatedOptions.find(
+ (option) => option.checked === 'on'
+ );
if (!clickedItem) return;
if (clickedItem && clickedItem.url) console.log(clickedItem.url);
};
diff --git a/src-docs/src/views/selectable/selectable.tsx b/src-docs/src/views/selectable/selectable.tsx
index 75977051b5b..aeb9948da16 100644
--- a/src-docs/src/views/selectable/selectable.tsx
+++ b/src-docs/src/views/selectable/selectable.tsx
@@ -11,8 +11,8 @@ export default () => {
aria-label="Basic example"
options={options}
listProps={{ bordered: true }}
- onChange={newOptions => setOptions(newOptions)}>
- {list => list}
+ onChange={(newOptions) => setOptions(newOptions)}>
+ {(list) => list}
);
};
diff --git a/src-docs/src/views/selectable/selectable_custom_render.js b/src-docs/src/views/selectable/selectable_custom_render.js
index 9688e3be4cd..f5f6bbf316c 100644
--- a/src-docs/src/views/selectable/selectable_custom_render.js
+++ b/src-docs/src/views/selectable/selectable_custom_render.js
@@ -13,7 +13,7 @@ import { createDataStore } from '../tables/data_store';
export default () => {
const [useCustomContent, setUseCustomContent] = useState(false);
- const countries = createDataStore().countries.map(country => {
+ const countries = createDataStore().countries.map((country) => {
return {
label: `${country.name}`,
searchableLabel: `${country.name} ${'I am secondary content, I am!'}`,
@@ -29,11 +29,11 @@ export default () => {
const [options, setOptions] = useState(countries);
- const onChange = options => {
+ const onChange = (options) => {
setOptions(options);
};
- const onCustom = e => {
+ const onCustom = (e) => {
setUseCustomContent(e.currentTarget.checked);
};
diff --git a/src-docs/src/views/selectable/selectable_exclusion.tsx b/src-docs/src/views/selectable/selectable_exclusion.tsx
index 48614971c55..9b79f689881 100644
--- a/src-docs/src/views/selectable/selectable_exclusion.tsx
+++ b/src-docs/src/views/selectable/selectable_exclusion.tsx
@@ -11,8 +11,8 @@ export default () => {
aria-label="Example of Selectable supporting exclusions"
allowExclusions
options={options}
- onChange={newOptions => setOptions(newOptions)}>
- {list => list}
+ onChange={(newOptions) => setOptions(newOptions)}>
+ {(list) => list}
);
};
diff --git a/src-docs/src/views/selectable/selectable_messages.tsx b/src-docs/src/views/selectable/selectable_messages.tsx
index 69fc556b3ab..8f534c96ec8 100644
--- a/src-docs/src/views/selectable/selectable_messages.tsx
+++ b/src-docs/src/views/selectable/selectable_messages.tsx
@@ -15,13 +15,13 @@ export default () => {
setUseCustomMessage(e.target.checked)}
+ onChange={(e) => setUseCustomMessage(e.target.checked)}
checked={useCustomMessage}
/>
setIsLoading(e.target.checked)}
+ onChange={(e) => setIsLoading(e.target.checked)}
checked={isLoading}
/>
@@ -33,7 +33,7 @@ export default () => {
isLoading={isLoading}
loadingMessage={useCustomMessage ? loadingMessage : undefined}
emptyMessage={useCustomMessage ? emptyMessage : undefined}>
- {list => list}
+ {(list) => list}
);
diff --git a/src-docs/src/views/selectable/selectable_popover.js b/src-docs/src/views/selectable/selectable_popover.js
index dc9afc30529..ad5b1ccaa2c 100644
--- a/src-docs/src/views/selectable/selectable_popover.js
+++ b/src-docs/src/views/selectable/selectable_popover.js
@@ -18,7 +18,7 @@ import { Options } from './data';
import { createDataStore } from '../tables/data_store';
export default () => {
- const countriesStore = createDataStore().countries.map(country => {
+ const countriesStore = createDataStore().countries.map((country) => {
return {
id: country.code,
label: `${country.name}`,
@@ -40,11 +40,11 @@ export default () => {
setIsPopoverOpen(false);
};
- const onChange = options => {
+ const onChange = (options) => {
setOptions(options);
};
- const onFlyoutChange = options => {
+ const onFlyoutChange = (options) => {
setCountries(options);
};
@@ -141,7 +141,7 @@ export default () => {
onChange={() => {}}
style={{ width: 300 }}
listProps={{ bordered: true }}>
- {list => list}
+ {(list) => list}
);
diff --git a/src-docs/src/views/selectable/selectable_search.tsx b/src-docs/src/views/selectable/selectable_search.tsx
index 6649a7ac9cd..f3bed2162e6 100644
--- a/src-docs/src/views/selectable/selectable_search.tsx
+++ b/src-docs/src/views/selectable/selectable_search.tsx
@@ -15,7 +15,7 @@ export default () => {
'data-test-subj': 'selectableSearchHere',
}}
options={options}
- onChange={newOptions => setOptions(newOptions)}>
+ onChange={(newOptions) => setOptions(newOptions)}>
{(list, search) => (
{search}
diff --git a/src-docs/src/views/selectable/selectable_single.tsx b/src-docs/src/views/selectable/selectable_single.tsx
index 41535529f19..4d1476db276 100644
--- a/src-docs/src/views/selectable/selectable_single.tsx
+++ b/src-docs/src/views/selectable/selectable_single.tsx
@@ -5,7 +5,7 @@ import { Options } from './data';
export default () => {
const [options, setOptions] = useState(
- Options.map(option => {
+ Options.map((option) => {
const { checked, ...checklessOption } = option;
return { ...checklessOption };
})
@@ -15,10 +15,10 @@ export default () => {
setOptions(newOptions)}
+ onChange={(newOptions) => setOptions(newOptions)}
singleSelection={true}
listProps={{ bordered: true }}>
- {list => list}
+ {(list) => list}
);
};
diff --git a/src-docs/src/views/side_nav/side_nav_complex.js b/src-docs/src/views/side_nav/side_nav_complex.js
index e2e93d78d8b..cadf47c35b9 100644
--- a/src-docs/src/views/side_nav/side_nav_complex.js
+++ b/src-docs/src/views/side_nav/side_nav_complex.js
@@ -10,7 +10,7 @@ export default () => {
setIsSideNavOpenOnMobile(!isSideNavOpenOnMobile);
};
- const selectItem = name => {
+ const selectItem = (name) => {
setSelectedItem(name);
};
diff --git a/src-docs/src/views/side_nav/side_nav_force_open.js b/src-docs/src/views/side_nav/side_nav_force_open.js
index 12b784d6dc5..90532a862a8 100644
--- a/src-docs/src/views/side_nav/side_nav_force_open.js
+++ b/src-docs/src/views/side_nav/side_nav_force_open.js
@@ -10,7 +10,7 @@ export default () => {
setIsSideNavOpenOnMobile(!isSideNavOpenOnMobile);
};
- const selectItem = name => {
+ const selectItem = (name) => {
setSelectedItem(name);
};
diff --git a/src-docs/src/views/stat/stat_combos.js b/src-docs/src/views/stat/stat_combos.js
index ca419f495cb..e0c7ab9c539 100644
--- a/src-docs/src/views/stat/stat_combos.js
+++ b/src-docs/src/views/stat/stat_combos.js
@@ -13,7 +13,7 @@ import {
export default () => {
const [isLoading, setLoading] = useState(false);
- const onToggleChange = e => {
+ const onToggleChange = (e) => {
setLoading(e.target.checked);
};
diff --git a/src-docs/src/views/stat/stat_loading.js b/src-docs/src/views/stat/stat_loading.js
index 33a1cb234b8..612174c206d 100644
--- a/src-docs/src/views/stat/stat_loading.js
+++ b/src-docs/src/views/stat/stat_loading.js
@@ -5,7 +5,7 @@ import { EuiSwitch, EuiStat, EuiSpacer } from '../../../../src/components';
export default () => {
const [isLoading, setLoading] = useState(true);
- const onToggleChange = e => {
+ const onToggleChange = (e) => {
setLoading(e.target.checked);
};
diff --git a/src-docs/src/views/suggest/global_filter_bar.js b/src-docs/src/views/suggest/global_filter_bar.js
index aefa66cb3dd..ddb7ce4b4d8 100644
--- a/src-docs/src/views/suggest/global_filter_bar.js
+++ b/src-docs/src/views/suggest/global_filter_bar.js
@@ -10,14 +10,14 @@ export const GlobalFilterBar = ({ filters, className, ...rest }) => {
const classes = classNames('globalFilterBar', className);
const pinnedFilters = filters
- .filter(filter => filter.isPinned)
- .map(filter => {
+ .filter((filter) => filter.isPinned)
+ .map((filter) => {
return ;
});
const unpinnedFilters = filters
- .filter(filter => !filter.isPinned)
- .map(filter => {
+ .filter((filter) => !filter.isPinned)
+ .map((filter) => {
return ;
});
diff --git a/src-docs/src/views/suggest/global_filter_form.js b/src-docs/src/views/suggest/global_filter_form.js
index 65e60fc524e..f0408a9a80d 100644
--- a/src-docs/src/views/suggest/global_filter_form.js
+++ b/src-docs/src/views/suggest/global_filter_form.js
@@ -68,7 +68,7 @@ const valueOption = [
},
];
-const GlobalFilterForm = props => {
+const GlobalFilterForm = (props) => {
const [fieldOptions, setFieldOptions] = useState(fieldOption);
const [operandOptions, setOperandOptions] = useState(operatorOption);
const [valueOptions, setValueOptions] = useState(valueOption);
@@ -84,43 +84,43 @@ const GlobalFilterForm = props => {
const [useCustomLabel, setUseCoustomLabel] = useState(false);
const [customLabel, setCustomLabel] = useState('');
- const onFieldChange = selectedOptions => {
+ const onFieldChange = (selectedOptions) => {
// We should only get back either 0 or 1 options.
setSelectedField(selectedOptions);
};
- const onOperandChange = selectedOptions => {
+ const onOperandChange = (selectedOptions) => {
// We should only get back either 0 or 1 options.
setSelectedOperand(selectedOptions);
};
- const onValuesChange = selectedOptions => {
+ const onValuesChange = (selectedOptions) => {
setSelectedValues(selectedOptions);
};
- const onCustomLabelSwitchChange = e => {
+ const onCustomLabelSwitchChange = (e) => {
setCustomLabel(e.target.checked);
};
- const onFieldSearchChange = searchValue => {
+ const onFieldSearchChange = (searchValue) => {
setFieldOptions(
- fieldOption.filter(option =>
+ fieldOption.filter((option) =>
option.label.toLowerCase().includes(searchValue.toLowerCase())
)
);
};
- const onOperandSearchChange = searchValue => {
+ const onOperandSearchChange = (searchValue) => {
setOperandOptions(
- operatorOption.filter(option =>
+ operatorOption.filter((option) =>
option.label.toLowerCase().includes(searchValue.toLowerCase())
)
);
};
- const onValuesSearchChange = searchValue => {
+ const onValuesSearchChange = (searchValue) => {
setValueOptions(
- valueOption.filter(option =>
+ valueOption.filter((option) =>
option.label.toLowerCase().includes(searchValue.toLowerCase())
)
);
@@ -134,7 +134,7 @@ const GlobalFilterForm = props => {
setCustomLabel(null);
};
- const onCustomLabelChange = value => {
+ const onCustomLabelChange = (value) => {
console.log(value);
// setCustomLabel()
};
diff --git a/src-docs/src/views/suggest/global_filter_item.js b/src-docs/src/views/suggest/global_filter_item.js
index daca167d83a..91f0137a524 100644
--- a/src-docs/src/views/suggest/global_filter_item.js
+++ b/src-docs/src/views/suggest/global_filter_item.js
@@ -13,7 +13,7 @@ function flattenPanelTree(tree, array = []) {
array.push(tree);
if (tree.items) {
- tree.items.forEach(item => {
+ tree.items.forEach((item) => {
if (item.panel) {
flattenPanelTree(item.panel, array);
item.panel = item.panel.id;
@@ -24,7 +24,7 @@ function flattenPanelTree(tree, array = []) {
return array;
}
-export const GlobalFilterItem = props => {
+export const GlobalFilterItem = (props) => {
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
const togglePopover = () => {
setIsPopoverOpen(!isPopoverOpen);
@@ -34,7 +34,7 @@ export const GlobalFilterItem = props => {
setIsPopoverOpen(false);
};
- const deleteFilter = e => {
+ const deleteFilter = (e) => {
window.alert('Filter would have been deleted.');
// Make sure it doesn't also trigger the onclick for the whole badge
e.stopPropagation();
diff --git a/src-docs/src/views/suggest/global_filter_options.js b/src-docs/src/views/suggest/global_filter_options.js
index 094f496c983..cc8d243a9f1 100644
--- a/src-docs/src/views/suggest/global_filter_options.js
+++ b/src-docs/src/views/suggest/global_filter_options.js
@@ -11,7 +11,7 @@ function flattenPanelTree(tree, array = []) {
array.push(tree);
if (tree.items) {
- tree.items.forEach(item => {
+ tree.items.forEach((item) => {
if (item.panel) {
flattenPanelTree(item.panel, array);
item.panel = item.panel.id;
diff --git a/src-docs/src/views/suggest/hashtag_popover.js b/src-docs/src/views/suggest/hashtag_popover.js
index f557aa28169..9cbc7b00600 100644
--- a/src-docs/src/views/suggest/hashtag_popover.js
+++ b/src-docs/src/views/suggest/hashtag_popover.js
@@ -14,7 +14,7 @@ import {
EuiText,
} from '../../../../src/components';
-export default props => {
+export default (props) => {
const [isPopoverOpen, setPopover] = useState(false);
const togglePopover = () => {
@@ -81,9 +81,7 @@ export default props => {
- ) : (
- undefined
- )}
+ ) : undefined}
);
diff --git a/src-docs/src/views/suggest/saved_queries.js b/src-docs/src/views/suggest/saved_queries.js
index c9124e598f4..f1de1025596 100644
--- a/src-docs/src/views/suggest/saved_queries.js
+++ b/src-docs/src/views/suggest/saved_queries.js
@@ -97,11 +97,11 @@ export default () => {
setHide(false);
};
- const getInputValue = val => {
+ const getInputValue = (val) => {
setValue(val);
};
- const onItemClick = item => {
+ const onItemClick = (item) => {
alert(`Item [${item.label}] was clicked`);
};
diff --git a/src-docs/src/views/suggest/suggest.js b/src-docs/src/views/suggest/suggest.js
index 287a793baea..2b1966824db 100644
--- a/src-docs/src/views/suggest/suggest.js
+++ b/src-docs/src/views/suggest/suggest.js
@@ -53,12 +53,12 @@ export default () => {
const [status, setStatus] = useState('unchanged');
const [radioIdSelected, setSelectedId] = useState(`${idPrefix}0`);
- const onChange = optionId => {
+ const onChange = (optionId) => {
setSelectedId(optionId);
- setStatus(radios.find(x => x.id === optionId).value);
+ setStatus(radios.find((x) => x.id === optionId).value);
};
- const onItemClick = item => {
+ const onItemClick = (item) => {
alert(`Item [${item.label}] was clicked`);
};
@@ -67,7 +67,7 @@ export default () => {
onChange(id)}
+ onChange={(id) => onChange(id)}
/>
{
const [refreshInterval, setRefreshInterval] = useState();
const onTimeChange = ({ start, end }) => {
- const recentlyUsedRange = recentlyUsedRanges.filter(recentlyUsedRange => {
+ const recentlyUsedRange = recentlyUsedRanges.filter((recentlyUsedRange) => {
const isDuplicate =
recentlyUsedRange.start === start && recentlyUsedRange.end === end;
return !isDuplicate;
@@ -36,18 +36,18 @@ export default () => {
};
const onRefresh = ({ start, end, refreshInterval }) => {
- return new Promise(resolve => {
+ return new Promise((resolve) => {
setTimeout(resolve, 100);
}).then(() => {
console.log(start, end, refreshInterval);
});
};
- const onStartInputChange = e => {
+ const onStartInputChange = (e) => {
setStart(e.target.value);
};
- const onEndInputChange = e => {
+ const onEndInputChange = (e) => {
setEnd(e.target.value);
};
diff --git a/src-docs/src/views/super_date_picker/super_date_picker_config.js b/src-docs/src/views/super_date_picker/super_date_picker_config.js
index 0fc8fb38e6c..10c6915bfd4 100644
--- a/src-docs/src/views/super_date_picker/super_date_picker_config.js
+++ b/src-docs/src/views/super_date_picker/super_date_picker_config.js
@@ -18,7 +18,7 @@ export default () => {
const [refreshInterval, setRefreshInterval] = useState();
const onTimeChange = ({ start, end }) => {
- const recentlyUsedRange = recentlyUsedRanges.filter(recentlyUsedRange => {
+ const recentlyUsedRange = recentlyUsedRanges.filter((recentlyUsedRange) => {
const isDuplicate =
recentlyUsedRange.start === start && recentlyUsedRange.end === end;
return !isDuplicate;
@@ -36,7 +36,7 @@ export default () => {
};
const onRefresh = ({ start, end, refreshInterval }) => {
- return new Promise(resolve => {
+ return new Promise((resolve) => {
setTimeout(resolve, 100);
}).then(() => {
console.log(start, end, refreshInterval);
diff --git a/src-docs/src/views/super_date_picker/super_date_picker_custom_quick_select.js b/src-docs/src/views/super_date_picker/super_date_picker_custom_quick_select.js
index acf363123b1..580f151cc1c 100644
--- a/src-docs/src/views/super_date_picker/super_date_picker_custom_quick_select.js
+++ b/src-docs/src/views/super_date_picker/super_date_picker_custom_quick_select.js
@@ -29,7 +29,7 @@ export default () => {
const [refreshInterval, setRefreshInterval] = useState();
const onTimeChange = ({ start, end }) => {
- const recentlyUsedRange = recentlyUsedRanges.filter(recentlyUsedRange => {
+ const recentlyUsedRange = recentlyUsedRanges.filter((recentlyUsedRange) => {
const isDuplicate =
recentlyUsedRange.start === start && recentlyUsedRange.end === end;
return !isDuplicate;
@@ -47,7 +47,7 @@ export default () => {
};
const onRefresh = ({ start, end, refreshInterval }) => {
- return new Promise(resolve => {
+ return new Promise((resolve) => {
setTimeout(resolve, 100);
}).then(() => {
console.log(start, end, refreshInterval);
diff --git a/src-docs/src/views/super_select/super_select_basic.js b/src-docs/src/views/super_select/super_select_basic.js
index 7f72ef2af73..cd388843b25 100644
--- a/src-docs/src/views/super_select/super_select_basic.js
+++ b/src-docs/src/views/super_select/super_select_basic.js
@@ -35,7 +35,7 @@ export default () => {
];
const [value, setValue] = useState(options[1].value);
- const onChange = value => {
+ const onChange = (value) => {
setValue(value);
};
@@ -43,7 +43,7 @@ export default () => {
onChange(value)}
+ onChange={(value) => onChange(value)}
/>
);
};
diff --git a/src-docs/src/views/super_select/super_select_complex.js b/src-docs/src/views/super_select/super_select_complex.js
index 1166a86bc07..5f78c3a2e48 100644
--- a/src-docs/src/views/super_select/super_select_complex.js
+++ b/src-docs/src/views/super_select/super_select_complex.js
@@ -50,7 +50,7 @@ export default () => {
const [value, setValue] = useState('option_one');
- const onChange = value => {
+ const onChange = (value) => {
setValue(value);
};
@@ -58,7 +58,7 @@ export default () => {
onChange(value)}
+ onChange={(value) => onChange(value)}
itemLayoutAlign="top"
hasDividers
/>
diff --git a/src-docs/src/views/super_select/super_select_states.js b/src-docs/src/views/super_select/super_select_states.js
index 9f08624cdf0..7d9523ebeeb 100644
--- a/src-docs/src/views/super_select/super_select_states.js
+++ b/src-docs/src/views/super_select/super_select_states.js
@@ -26,7 +26,7 @@ export default () => {
];
const [value, setValue] = useState(options[1].value);
- const onChange = value => {
+ const onChange = (value) => {
setValue(value);
};
@@ -36,7 +36,7 @@ export default () => {
onChange(value)}
+ onChange={(value) => onChange(value)}
/>
);
diff --git a/src-docs/src/views/tables/actions/actions.js b/src-docs/src/views/tables/actions/actions.js
index 6545e5cc5b5..d380d6f2425 100644
--- a/src-docs/src/views/tables/actions/actions.js
+++ b/src-docs/src/views/tables/actions/actions.js
@@ -58,12 +58,12 @@ export const Table = () => {
};
const onClickDelete = () => {
- store.deleteUsers(...selectedItems.map(user => user.id));
+ store.deleteUsers(...selectedItems.map((user) => user.id));
setSelectedItems([]);
};
- const onSelectionChange = selectedItems => {
+ const onSelectionChange = (selectedItems) => {
setSelectedItems(selectedItems);
};
@@ -89,12 +89,12 @@ export const Table = () => {
setCustomAction(!customAction);
};
- const deleteUser = user => {
+ const deleteUser = (user) => {
store.deleteUsers(user.id);
setSelectedItems([]);
};
- const cloneUser = user => {
+ const cloneUser = (user) => {
store.cloneUser(user.id);
setSelectedItems([]);
};
@@ -114,7 +114,7 @@ export const Table = () => {
actions = customAction
? [
{
- render: item => {
+ render: (item) => {
return (
cloneUser(item)}>
Clone
@@ -123,7 +123,7 @@ export const Table = () => {
},
},
{
- render: item => {
+ render: (item) => {
return (
deleteUser(item)}>
Delete
@@ -141,7 +141,7 @@ export const Table = () => {
'data-test-subj': 'action-clone',
},
{
- name: item => (item.id ? 'Delete' : 'Remove'),
+ name: (item) => (item.id ? 'Delete' : 'Remove'),
description: 'Delete this user',
icon: 'trash',
color: 'danger',
@@ -183,7 +183,7 @@ export const Table = () => {
actions = customAction
? [
{
- render: item => {
+ render: (item) => {
return (
deleteUser(item)} color="danger">
Delete
@@ -213,7 +213,7 @@ export const Table = () => {
truncateText: true,
sortable: true,
mobileOptions: {
- render: item => (
+ render: (item) => (
{item.firstName} {item.lastName}
@@ -235,7 +235,7 @@ export const Table = () => {
{
field: 'github',
name: 'Github',
- render: username => (
+ render: (username) => (
{username}
@@ -245,13 +245,13 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -260,7 +260,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => {
+ render: (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
@@ -288,8 +288,8 @@ export const Table = () => {
};
const selection = {
- selectable: user => user.online,
- selectableMessage: selectable =>
+ selectable: (user) => user.online,
+ selectableMessage: (selectable) =>
!selectable ? 'User is currently offline' : undefined,
onSelectionChange: onSelectionChange,
};
diff --git a/src-docs/src/views/tables/auto/auto.js b/src-docs/src/views/tables/auto/auto.js
index da1949722d1..334c5cc0eb0 100644
--- a/src-docs/src/views/tables/auto/auto.js
+++ b/src-docs/src/views/tables/auto/auto.js
@@ -44,7 +44,7 @@ const columns = [
truncateText: true,
'data-test-subj': 'firstNameCell',
mobileOptions: {
- render: item => (
+ render: (item) => (
{item.firstName}{' '}
@@ -61,7 +61,7 @@ const columns = [
{
field: 'lastName',
name: 'Last Name',
- render: name => (
+ render: (name) => (
{name}
@@ -85,7 +85,7 @@ const customColumns = [
'data-test-subj': 'firstNameCell',
width: '20%',
mobileOptions: {
- render: item => (
+ render: (item) => (
{item.firstName}{' '}
@@ -102,7 +102,7 @@ const customColumns = [
{
field: 'lastName',
name: 'Last Name',
- render: name => (
+ render: (name) => (
{name}
@@ -119,7 +119,7 @@ const customColumns = [
const items = store.users.filter((user, index) => index < 10);
-const getRowProps = item => {
+const getRowProps = (item) => {
const { id } = item;
return {
'data-test-subj': `row-${id}`,
@@ -162,9 +162,9 @@ export const Table = () => {
const [layout, setLayout] = useState('fixed');
const [toggleIdSelected, setToggleIdSelected] = useState(`${idPrefix}0`);
- const onChange = optionId => {
+ const onChange = (optionId) => {
setToggleIdSelected(optionId);
- setLayout(toggleButtons.find(x => x.id === optionId).value);
+ setLayout(toggleButtons.find((x) => x.id === optionId).value);
};
let callOutText;
diff --git a/src-docs/src/views/tables/basic/basic.js b/src-docs/src/views/tables/basic/basic.js
index 746500eb0ca..53ead7e1faa 100644
--- a/src-docs/src/views/tables/basic/basic.js
+++ b/src-docs/src/views/tables/basic/basic.js
@@ -40,7 +40,7 @@ export const Table = () => {
sortable: true,
'data-test-subj': 'firstNameCell',
mobileOptions: {
- render: item => (
+ render: (item) => (
{item.firstName}{' '}
@@ -58,7 +58,7 @@ export const Table = () => {
field: 'lastName',
name: 'Last Name',
truncateText: true,
- render: name => (
+ render: (name) => (
{name}
@@ -75,12 +75,12 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -89,7 +89,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => {
+ render: (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
@@ -99,7 +99,7 @@ export const Table = () => {
const items = store.users.filter((user, index) => index < 10);
- const getRowProps = item => {
+ const getRowProps = (item) => {
const { id } = item;
return {
'data-test-subj': `row-${id}`,
diff --git a/src-docs/src/views/tables/custom/custom.js b/src-docs/src/views/tables/custom/custom.js
index b0be59d1fc9..e96b1012289 100644
--- a/src-docs/src/views/tables/custom/custom.js
+++ b/src-docs/src/views/tables/custom/custom.js
@@ -222,17 +222,17 @@ export default class extends Component {
[
{
name: 'title',
- getValue: item => item.title.toLowerCase(),
+ getValue: (item) => item.title.toLowerCase(),
isAscending: true,
},
{
name: 'dateCreated',
- getValue: item => item.dateCreated.toLowerCase(),
+ getValue: (item) => item.dateCreated.toLowerCase(),
isAscending: true,
},
{
name: 'magnitude',
- getValue: item => item.magnitude.toLowerCase(),
+ getValue: (item) => item.magnitude.toLowerCase(),
isAscending: true,
},
],
@@ -251,7 +251,7 @@ export default class extends Component {
label: '',
alignment: LEFT_ALIGNMENT,
width: '24px',
- cellProvider: cell => ,
+ cellProvider: (cell) => ,
mobileOptions: {
show: false,
},
@@ -332,7 +332,7 @@ export default class extends Component {
this.state.lastItemIndex = this.pager.getLastItemIndex();
}
- onChangeItemsPerPage = itemsPerPage => {
+ onChangeItemsPerPage = (itemsPerPage) => {
this.pager.setItemsPerPage(itemsPerPage);
this.setState({
itemsPerPage,
@@ -341,7 +341,7 @@ export default class extends Component {
});
};
- onChangePage = pageIndex => {
+ onChangePage = (pageIndex) => {
this.pager.goToPageIndex(pageIndex);
this.setState({
firstItemIndex: this.pager.getFirstItemIndex(),
@@ -349,7 +349,7 @@ export default class extends Component {
});
};
- onSort = prop => {
+ onSort = (prop) => {
this.sortableProperties.sortOn(prop);
this.setState({
@@ -357,8 +357,8 @@ export default class extends Component {
});
};
- toggleItem = itemId => {
- this.setState(previousState => {
+ toggleItem = (itemId) => {
+ this.setState((previousState) => {
const newItemIdToSelectedMap = {
...previousState.itemIdToSelectedMap,
[itemId]: !previousState.itemIdToSelectedMap[itemId],
@@ -374,7 +374,7 @@ export default class extends Component {
const allSelected = this.areAllItemsSelected();
const newItemIdToSelectedMap = {};
this.items.forEach(
- item => (newItemIdToSelectedMap[item.id] = !allSelected)
+ (item) => (newItemIdToSelectedMap[item.id] = !allSelected)
);
this.setState({
@@ -382,27 +382,27 @@ export default class extends Component {
});
};
- isItemSelected = itemId => {
+ isItemSelected = (itemId) => {
return this.state.itemIdToSelectedMap[itemId];
};
areAllItemsSelected = () => {
const indexOfUnselectedItem = this.items.findIndex(
- item => !this.isItemSelected(item.id)
+ (item) => !this.isItemSelected(item.id)
);
return indexOfUnselectedItem === -1;
};
areAnyRowsSelected = () => {
return (
- Object.keys(this.state.itemIdToSelectedMap).findIndex(id => {
+ Object.keys(this.state.itemIdToSelectedMap).findIndex((id) => {
return this.state.itemIdToSelectedMap[id];
}) !== -1
);
};
- togglePopover = itemId => {
- this.setState(previousState => {
+ togglePopover = (itemId) => {
+ this.setState((previousState) => {
const newItemIdToOpenActionsPopoverMap = {
...previousState.itemIdToOpenActionsPopoverMap,
[itemId]: !previousState.itemIdToOpenActionsPopoverMap[itemId],
@@ -414,10 +414,10 @@ export default class extends Component {
});
};
- closePopover = itemId => {
+ closePopover = (itemId) => {
// only update the state if this item's popover is open
if (this.isPopoverOpen(itemId)) {
- this.setState(previousState => {
+ this.setState((previousState) => {
const newItemIdToOpenActionsPopoverMap = {
...previousState.itemIdToOpenActionsPopoverMap,
[itemId]: false,
@@ -430,11 +430,11 @@ export default class extends Component {
}
};
- isPopoverOpen = itemId => {
+ isPopoverOpen = (itemId) => {
return this.state.itemIdToOpenActionsPopoverMap[itemId];
};
- renderSelectAll = mobile => {
+ renderSelectAll = (mobile) => {
return (
{
+ this.columns.forEach((column) => {
if (column.isCheckbox || !column.isSortable) {
return;
}
@@ -496,8 +496,8 @@ export default class extends Component {
}
renderRows() {
- const renderRow = item => {
- const cells = this.columns.map(column => {
+ const renderRow = (item) => {
+ const cells = this.columns.map((column) => {
const cell = item[column.id];
let child;
@@ -641,7 +641,7 @@ export default class extends Component {
totalItemCount: this.pager.getTotalPages(),
};
- this.columns.forEach(column => {
+ this.columns.forEach((column) => {
const footer = this.getColumnFooter(column, { items, pagination });
if (column.mobileOptions && column.mobileOptions.only) {
return; // exclude columns that only exist for mobile headers
diff --git a/src-docs/src/views/tables/data_store.js b/src-docs/src/views/tables/data_store.js
index ece0bdf5f7f..a9d1b73082a 100644
--- a/src-docs/src/views/tables/data_store.js
+++ b/src-docs/src/views/tables/data_store.js
@@ -72,8 +72,8 @@ const github = [
const dob = new Date(1980, 1, 1);
-const createUsers = countries => {
- return times(20, index => {
+const createUsers = (countries) => {
+ return times(20, (index) => {
return {
id: index,
firstName: index < 10 ? firstNames[index] : firstNames[index - 10],
@@ -81,7 +81,7 @@ const createUsers = countries => {
github: index < 10 ? github[index] : github[index - 10],
dateOfBirth: dob,
nationality: random.oneToOne(
- countries.map(country => country.code),
+ countries.map((country) => country.code),
index
),
online: index % 2 === 0,
@@ -129,22 +129,22 @@ export const createDataStore = () => {
},
deleteUsers: (...ids) => {
- ids.forEach(id => {
- const index = users.findIndex(user => user.id === id);
+ ids.forEach((id) => {
+ const index = users.findIndex((user) => user.id === id);
if (index >= 0) {
users.splice(index, 1);
}
});
},
- cloneUser: id => {
- const index = users.findIndex(user => user.id === id);
+ cloneUser: (id) => {
+ const index = users.findIndex((user) => user.id === id);
if (index >= 0) {
const user = users[index];
users.splice(index, 0, { ...user, id: users.length });
}
},
- getCountry: code => countries.find(country => country.code === code),
+ getCountry: (code) => countries.find((country) => country.code === code),
};
};
diff --git a/src-docs/src/views/tables/expanding_rows/expanding_rows.js b/src-docs/src/views/tables/expanding_rows/expanding_rows.js
index ffada4b1cdb..620a0e0acd1 100644
--- a/src-docs/src/views/tables/expanding_rows/expanding_rows.js
+++ b/src-docs/src/views/tables/expanding_rows/expanding_rows.js
@@ -55,12 +55,12 @@ export const Table = () => {
setSortDirection(sortDirection);
};
- const onSelectionChange = selectedItems => {
+ const onSelectionChange = (selectedItems) => {
setSelectedItems(selectedItems);
};
const onClickDelete = () => {
- store.deleteUsers(...selectedItems.map(user => user.id));
+ store.deleteUsers(...selectedItems.map((user) => user.id));
setSelectedItems([]);
};
@@ -76,7 +76,7 @@ export const Table = () => {
);
};
- const toggleDetails = item => {
+ const toggleDetails = (item) => {
const itemIdToExpandedRowMapValues = { ...itemIdToExpandedRowMap };
if (itemIdToExpandedRowMapValues[item.id]) {
delete itemIdToExpandedRowMapValues[item.id];
@@ -118,7 +118,7 @@ export const Table = () => {
sortable: true,
truncateText: true,
mobileOptions: {
- render: item => (
+ render: (item) => (
{item.firstName} {item.lastName}
@@ -141,7 +141,7 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
schema: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
@@ -160,7 +160,7 @@ export const Table = () => {
align: RIGHT_ALIGNMENT,
width: '40px',
isExpander: true,
- render: item => (
+ render: (item) => (
toggleDetails(item)}
aria-label={itemIdToExpandedRowMap[item.id] ? 'Collapse' : 'Expand'}
@@ -185,8 +185,8 @@ export const Table = () => {
};
const selection = {
- selectable: user => user.online,
- selectableMessage: selectable =>
+ selectable: (user) => user.online,
+ selectableMessage: (selectable) =>
!selectable ? 'User is currently offline' : undefined,
onSelectionChange: onSelectionChange,
};
diff --git a/src-docs/src/views/tables/footer/footer.js b/src-docs/src/views/tables/footer/footer.js
index 0c7723143da..0d7eb672782 100644
--- a/src-docs/src/views/tables/footer/footer.js
+++ b/src-docs/src/views/tables/footer/footer.js
@@ -55,12 +55,12 @@ export const Table = () => {
setSortDirection(sortDirection);
};
- const onSelectionChange = selectedItems => {
+ const onSelectionChange = (selectedItems) => {
setSelectedItems(selectedItems);
};
const onClickDelete = () => {
- store.deleteUsers(...selectedItems.map(user => user.id));
+ store.deleteUsers(...selectedItems.map((user) => user.id));
setSelectedItems([]);
};
@@ -77,7 +77,7 @@ export const Table = () => {
);
};
- const renderStatus = online => {
+ const renderStatus = (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
@@ -133,7 +133,7 @@ export const Table = () => {
footer: ({ items }) => (
{uniqBy(items, 'github').length} users
),
- render: username => (
+ render: (username) => (
{username}
@@ -143,7 +143,7 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
@@ -152,7 +152,7 @@ export const Table = () => {
footer: ({ items }) => (
{uniqBy(items, 'nationality').length} countries
),
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -161,10 +161,10 @@ export const Table = () => {
field: 'online',
name: 'Online',
footer: ({ items }) => (
- {items.filter(i => !!i.online).length} online
+ {items.filter((i) => !!i.online).length} online
),
dataType: 'boolean',
- render: online => renderStatus(online),
+ render: (online) => renderStatus(online),
sortable: true,
hideForMobile: true,
},
@@ -185,8 +185,8 @@ export const Table = () => {
};
const selection = {
- selectable: user => user.online,
- selectableMessage: selectable =>
+ selectable: (user) => user.online,
+ selectableMessage: (selectable) =>
!selectable ? 'User is currently offline' : undefined,
onSelectionChange: onSelectionChange,
};
diff --git a/src-docs/src/views/tables/in_memory/in_memory.js b/src-docs/src/views/tables/in_memory/in_memory.js
index b6120e86165..e680fd0f064 100644
--- a/src-docs/src/views/tables/in_memory/in_memory.js
+++ b/src-docs/src/views/tables/in_memory/in_memory.js
@@ -47,7 +47,7 @@ export const Table = () => {
{
field: 'github',
name: 'Github',
- render: username => (
+ render: (username) => (
{username}
@@ -57,13 +57,13 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -72,7 +72,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => {
+ render: (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
diff --git a/src-docs/src/views/tables/in_memory/in_memory_controlled_pagination.js b/src-docs/src/views/tables/in_memory/in_memory_controlled_pagination.js
index b230097aaea..b5faba9ce9b 100644
--- a/src-docs/src/views/tables/in_memory/in_memory_controlled_pagination.js
+++ b/src-docs/src/views/tables/in_memory/in_memory_controlled_pagination.js
@@ -47,7 +47,7 @@ export const Table = () => {
{
field: 'github',
name: 'Github',
- render: username => (
+ render: (username) => (
{username}
@@ -57,13 +57,13 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -72,7 +72,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => {
+ render: (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
@@ -92,7 +92,7 @@ export const Table = () => {
useEffect(() => {
const updateInterval = setInterval(() => {
- setUsers(users =>
+ setUsers((users) =>
// randomly toggle some of the online statuses
users.map(({ online, ...user }) => ({
...user,
diff --git a/src-docs/src/views/tables/in_memory/in_memory_search.js b/src-docs/src/views/tables/in_memory/in_memory_search.js
index f00590a281f..be7766a79c6 100644
--- a/src-docs/src/views/tables/in_memory/in_memory_search.js
+++ b/src-docs/src/views/tables/in_memory/in_memory_search.js
@@ -57,7 +57,7 @@ export const Table = () => {
{
field: 'github',
name: 'Github',
- render: username => (
+ render: (username) => (
{username}
@@ -67,13 +67,13 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -82,7 +82,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => {
+ render: (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
@@ -109,7 +109,7 @@ export const Table = () => {
field: 'nationality',
name: 'Nationality',
multiSelect: false,
- options: store.countries.map(country => ({
+ options: store.countries.map((country) => ({
value: country.code,
name: country.name,
view: `${country.flag} ${country.name}`,
diff --git a/src-docs/src/views/tables/in_memory/in_memory_search_callback.js b/src-docs/src/views/tables/in_memory/in_memory_search_callback.js
index dd58f9921b1..3954721e326 100644
--- a/src-docs/src/views/tables/in_memory/in_memory_search_callback.js
+++ b/src-docs/src/views/tables/in_memory/in_memory_search_callback.js
@@ -45,7 +45,7 @@ export const Table = () => {
setIsLoading(true);
requestTimeoutId = setTimeout(() => {
- const items = store.users.filter(user => {
+ const items = store.users.filter((user) => {
const normalizedName = `${user.firstName} ${user.lastName}`.toLowerCase();
const normalizedQuery = query.text.toLowerCase();
return normalizedName.indexOf(normalizedQuery) !== -1;
@@ -83,7 +83,7 @@ export const Table = () => {
{
field: 'github',
name: 'Github',
- render: username => (
+ render: (username) => (
{username}
@@ -93,13 +93,13 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -108,7 +108,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => {
+ render: (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
diff --git a/src-docs/src/views/tables/in_memory/in_memory_search_external.js b/src-docs/src/views/tables/in_memory/in_memory_search_external.js
index 3cee956bc59..0994b841bfe 100644
--- a/src-docs/src/views/tables/in_memory/in_memory_search_external.js
+++ b/src-docs/src/views/tables/in_memory/in_memory_search_external.js
@@ -63,7 +63,7 @@ export const Table = () => {
{
field: 'github',
name: 'Github',
- render: username => (
+ render: (username) => (
{username}
@@ -73,13 +73,13 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -88,7 +88,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => {
+ render: (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
@@ -96,13 +96,13 @@ export const Table = () => {
},
];
- const handleOnChange = search => {
+ const handleOnChange = (search) => {
setState(initialState);
setQuery(search.queryText);
return true;
};
- const handleCheckbox = e => {
+ const handleCheckbox = (e) => {
switch (e.target.id) {
case 'eu': {
const isChecked = !state.eu;
@@ -182,7 +182,7 @@ export const Table = () => {
field: 'nationality',
name: 'Nationality',
multiSelect: 'or',
- options: store.countries.map(country => ({
+ options: store.countries.map((country) => ({
value: country.code,
name: country.name,
view: `${country.flag} ${country.name}`,
diff --git a/src-docs/src/views/tables/in_memory/in_memory_selection.js b/src-docs/src/views/tables/in_memory/in_memory_selection.js
index 6a149cb65f5..7f05b489991 100644
--- a/src-docs/src/views/tables/in_memory/in_memory_selection.js
+++ b/src-docs/src/views/tables/in_memory/in_memory_selection.js
@@ -99,7 +99,7 @@ export const Table = () => {
}
const onClick = () => {
- store.deleteUsers(...selection.map(user => user.id));
+ store.deleteUsers(...selection.map((user) => user.id));
setSelection([]);
};
@@ -146,7 +146,7 @@ export const Table = () => {
{
field: 'github',
name: 'Github',
- render: username => (
+ render: (username) => (
{username}
@@ -156,13 +156,13 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -171,7 +171,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => {
+ render: (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
@@ -198,7 +198,7 @@ export const Table = () => {
field: 'nationality',
name: 'Nationality',
multiSelect: false,
- options: store.countries.map(country => ({
+ options: store.countries.map((country) => ({
value: country.code,
name: country.name,
view: `${country.flag} ${country.name}`,
@@ -212,13 +212,13 @@ export const Table = () => {
pageSizeOptions: [3, 5, 8],
};
- const onlineUsers = store.users.filter(user => user.online);
+ const onlineUsers = store.users.filter((user) => user.online);
const selectionValue = {
- selectable: user => user.online,
- selectableMessage: selectable =>
+ selectable: (user) => user.online,
+ selectableMessage: (selectable) =>
!selectable ? 'User is currently offline' : undefined,
- onSelectionChange: selection => setSelection(selection),
+ onSelectionChange: (selection) => setSelection(selection),
initialSelected: onlineUsers,
};
diff --git a/src-docs/src/views/tables/mobile/mobile.js b/src-docs/src/views/tables/mobile/mobile.js
index 244d56e5bd3..70a20d539a3 100644
--- a/src-docs/src/views/tables/mobile/mobile.js
+++ b/src-docs/src/views/tables/mobile/mobile.js
@@ -56,7 +56,7 @@ export const Table = () => {
setSortDirection(sortDirection);
};
- const onSelectionChange = selectedItems => {
+ const onSelectionChange = (selectedItems) => {
setSelectedItems(selectedItems);
};
@@ -68,12 +68,12 @@ export const Table = () => {
setIsResponsive(!isResponsive);
};
- const deleteUser = user => {
+ const deleteUser = (user) => {
store.deleteUsers(user.id);
setSelectedItems([]);
};
- const cloneUser = user => {
+ const cloneUser = (user) => {
store.cloneUser(user.id);
setSelectedItems([]);
};
@@ -111,7 +111,7 @@ export const Table = () => {
sortable: true,
mobileOptions: {
render: customHeader
- ? item => (
+ ? (item) => (
{item.firstName} {item.lastName}
@@ -134,7 +134,7 @@ export const Table = () => {
{
field: 'github',
name: 'Github',
- render: username => (
+ render: (username) => (
{username}
@@ -144,13 +144,13 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -159,7 +159,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => {
+ render: (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
@@ -187,8 +187,8 @@ export const Table = () => {
};
const selection = {
- selectable: user => user.online,
- selectableMessage: selectable =>
+ selectable: (user) => user.online,
+ selectableMessage: (selectable) =>
!selectable ? 'User is currently offline' : undefined,
onSelectionChange: onSelectionChange,
};
diff --git a/src-docs/src/views/tables/paginated/paginated.js b/src-docs/src/views/tables/paginated/paginated.js
index ddf12379890..aaccb37a24f 100644
--- a/src-docs/src/views/tables/paginated/paginated.js
+++ b/src-docs/src/views/tables/paginated/paginated.js
@@ -49,7 +49,7 @@ export const Table = () => {
setPageSize(pageSize);
};
- const renderStatus = online => {
+ const renderStatus = (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
@@ -98,7 +98,7 @@ export const Table = () => {
{
field: 'github',
name: 'Github',
- render: username => (
+ render: (username) => (
{username}
@@ -108,12 +108,12 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -122,7 +122,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => renderStatus(online),
+ render: (online) => renderStatus(online),
},
];
diff --git a/src-docs/src/views/tables/selection/selection.js b/src-docs/src/views/tables/selection/selection.js
index 592553093de..e20f8254cad 100644
--- a/src-docs/src/views/tables/selection/selection.js
+++ b/src-docs/src/views/tables/selection/selection.js
@@ -55,12 +55,12 @@ export const Table = () => {
setSortDirection(sortDirection);
};
- const onSelectionChange = selectedItems => {
+ const onSelectionChange = (selectedItems) => {
setSelectedItems(selectedItems);
};
const onClickDelete = () => {
- store.deleteUsers(...selectedItems.map(user => user.id));
+ store.deleteUsers(...selectedItems.map((user) => user.id));
setSelectedItems([]);
};
@@ -77,7 +77,7 @@ export const Table = () => {
);
};
- const renderStatus = online => {
+ const renderStatus = (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
@@ -131,7 +131,7 @@ export const Table = () => {
{
field: 'github',
name: 'Github',
- render: username => (
+ render: (username) => (
{username}
@@ -141,13 +141,13 @@ export const Table = () => {
field: 'dateOfBirth',
name: 'Date of Birth',
dataType: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
field: 'nationality',
name: 'Nationality',
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -156,7 +156,7 @@ export const Table = () => {
field: 'online',
name: 'Online',
dataType: 'boolean',
- render: online => renderStatus(online),
+ render: (online) => renderStatus(online),
sortable: true,
mobileOptions: {
show: false,
@@ -178,11 +178,11 @@ export const Table = () => {
},
};
- const onlineUsers = store.users.filter(user => user.online);
+ const onlineUsers = store.users.filter((user) => user.online);
const selection = {
- selectable: user => user.online,
- selectableMessage: selectable =>
+ selectable: (user) => user.online,
+ selectableMessage: (selectable) =>
!selectable ? 'User is currently offline' : undefined,
onSelectionChange: onSelectionChange,
initialSelected: onlineUsers,
diff --git a/src-docs/src/views/tables/sorting/sorting.js b/src-docs/src/views/tables/sorting/sorting.js
index de579625b39..b2c5c299353 100644
--- a/src-docs/src/views/tables/sorting/sorting.js
+++ b/src-docs/src/views/tables/sorting/sorting.js
@@ -65,7 +65,7 @@ export const Table = () => {
sortable: true,
truncateText: true,
mobileOptions: {
- render: item => (
+ render: (item) => (
{item.firstName} {item.lastName}
@@ -101,7 +101,7 @@ export const Table = () => {
),
sortable: true,
- render: username => (
+ render: (username) => (
{username}
@@ -123,7 +123,7 @@ export const Table = () => {
),
schema: 'date',
- render: date => formatDate(date, 'dobLong'),
+ render: (date) => formatDate(date, 'dobLong'),
sortable: true,
},
{
@@ -142,7 +142,7 @@ export const Table = () => {
),
sortable: true,
- render: countryCode => {
+ render: (countryCode) => {
const country = store.getCountry(countryCode);
return `${country.flag} ${country.name}`;
},
@@ -164,7 +164,7 @@ export const Table = () => {
),
schema: 'boolean',
sortable: true,
- render: online => {
+ render: (online) => {
const color = online ? 'success' : 'danger';
const label = online ? 'Online' : 'Offline';
return {label};
diff --git a/src-docs/src/views/tabs/controlled.js b/src-docs/src/views/tabs/controlled.js
index 1d42588415d..d3e8b254f32 100644
--- a/src-docs/src/views/tabs/controlled.js
+++ b/src-docs/src/views/tabs/controlled.js
@@ -91,7 +91,7 @@ const tabs = [
export default () => {
const [selectedTab, setSelectedTab] = useState(tabs[1]);
- const onTabClick = selectedTab => {
+ const onTabClick = (selectedTab) => {
setSelectedTab(selectedTab);
};
diff --git a/src-docs/src/views/tabs/tabbed_content.js b/src-docs/src/views/tabs/tabbed_content.js
index a7a47a0e015..22e7af71bd2 100644
--- a/src-docs/src/views/tabs/tabbed_content.js
+++ b/src-docs/src/views/tabs/tabbed_content.js
@@ -93,7 +93,7 @@ export default () => {
tabs={tabs}
initialSelectedTab={tabs[1]}
autoFocus="selected"
- onTabClick={tab => {
+ onTabClick={(tab) => {
console.log('clicked tab', tab);
}}
/>
diff --git a/src-docs/src/views/tabs/tabs.js b/src-docs/src/views/tabs/tabs.js
index a997b4eeeac..686114aa980 100644
--- a/src-docs/src/views/tabs/tabs.js
+++ b/src-docs/src/views/tabs/tabs.js
@@ -44,7 +44,7 @@ const tabs = [
export default () => {
const [selectedTabId, setSelectedTabId] = useState('cobalt');
- const onSelectedTabChanged = id => {
+ const onSelectedTabChanged = (id) => {
setSelectedTabId(id);
};
diff --git a/src-docs/src/views/tabs/tabs_condensed.js b/src-docs/src/views/tabs/tabs_condensed.js
index 9c08925de44..6040dac232a 100644
--- a/src-docs/src/views/tabs/tabs_condensed.js
+++ b/src-docs/src/views/tabs/tabs_condensed.js
@@ -33,7 +33,7 @@ const tabs = [
export default () => {
const [selectedTabId, setSelectedTabId] = useState('cobalt');
- const onSelectedTabChanged = id => {
+ const onSelectedTabChanged = (id) => {
setSelectedTabId(id);
};
diff --git a/src-docs/src/views/text_diff/text_diff.js b/src-docs/src/views/text_diff/text_diff.js
index 297638dad2b..8e11c834740 100644
--- a/src-docs/src/views/text_diff/text_diff.js
+++ b/src-docs/src/views/text_diff/text_diff.js
@@ -23,11 +23,11 @@ export default () => {
});
useEffect(() => {
- textDiffObject.forEach(el => {
+ textDiffObject.forEach((el) => {
if (el[0] === 1) {
- setIns(add => add + 1);
+ setIns((add) => add + 1);
} else if (el[0] === -1) {
- setDel(sub => sub + 1);
+ setDel((sub) => sub + 1);
}
});
// eslint-disable-next-line react-hooks/exhaustive-deps
diff --git a/src-docs/src/views/toast/toast_list.js b/src-docs/src/views/toast/toast_list.js
index 62c2494c01a..630f44d76d7 100644
--- a/src-docs/src/views/toast/toast_list.js
+++ b/src-docs/src/views/toast/toast_list.js
@@ -29,8 +29,8 @@ export default () => {
setToasts(toasts.concat(toast));
};
- const removeToast = removedToast => {
- setToasts(toasts.filter(toast => toast.id !== removedToast.id));
+ const removeToast = (removedToast) => {
+ setToasts(toasts.filter((toast) => toast.id !== removedToast.id));
};
removeAllToastsHandler = () => {
diff --git a/src-docs/src/views/toggle/toggle.js b/src-docs/src/views/toggle/toggle.js
index a33738fc50a..04375eac8db 100644
--- a/src-docs/src/views/toggle/toggle.js
+++ b/src-docs/src/views/toggle/toggle.js
@@ -2,16 +2,16 @@ import React, { useState } from 'react';
import { EuiToggle } from '../../../../src/components';
-export default function() {
+export default function () {
const [toggleOn, setToggleValue] = useState(false);
- const onToggleChange = e => {
+ const onToggleChange = (e) => {
setToggleValue(e.target.checked);
};
return (
- onToggleChange(e)} label="Is toggle on?">
+ onToggleChange(e)} label="Is toggle on?">
{toggleOn ? 'On' : 'Off'}
diff --git a/src-docs/src/views/tour/fullscreen.js b/src-docs/src/views/tour/fullscreen.js
index 2dd6594619f..b79159e15d4 100644
--- a/src-docs/src/views/tour/fullscreen.js
+++ b/src-docs/src/views/tour/fullscreen.js
@@ -67,14 +67,14 @@ export default () => {
reducerState,
] = useEuiTour(demoTourSteps, tourConfig);
- const onSelectColor = color => {
+ const onSelectColor = (color) => {
setColor(color);
if (reducerState.currentTourStep === 2) {
actions.goToStep(3);
}
};
- const onTabClick = id => {
+ const onTabClick = (id) => {
if (id === 'stat' && reducerState.currentTourStep === 3) {
actions.goToStep(4);
}
@@ -174,7 +174,7 @@ export default () => {
return (
- {setIsFullScreen => (
+ {(setIsFullScreen) => (
diff --git a/src-docs/src/views/tour/managed.js b/src-docs/src/views/tour/managed.js
index d3d07a2c6f5..b744e8831a2 100644
--- a/src-docs/src/views/tour/managed.js
+++ b/src-docs/src/views/tour/managed.js
@@ -71,7 +71,7 @@ export default () => {
setQueryValue('');
};
- const onChange = e => {
+ const onChange = (e) => {
setQueryValue(e.target.value);
if (reducerState.currentTourStep < 2) {
diff --git a/src-docs/src/views/tour/managed_hook.js b/src-docs/src/views/tour/managed_hook.js
index 9577dbe21ef..5e6590b66fe 100644
--- a/src-docs/src/views/tour/managed_hook.js
+++ b/src-docs/src/views/tour/managed_hook.js
@@ -72,7 +72,7 @@ export default () => {
setQueryValue('');
};
- const onChange = e => {
+ const onChange = (e) => {
setQueryValue(e.target.value);
if (reducerState.currentTourStep < 2) {
diff --git a/src-docs/src/views/tour/tour.js b/src-docs/src/views/tour/tour.js
index 529e323ee6a..a6e0f04b304 100644
--- a/src-docs/src/views/tour/tour.js
+++ b/src-docs/src/views/tour/tour.js
@@ -87,7 +87,7 @@ export default () => {
});
};
- const onChange = e => {
+ const onChange = (e) => {
setQueryValue(e.target.value);
if (state.currentTourStep < 2) {
diff --git a/src-docs/src/views/window_event/modal_example_container.js b/src-docs/src/views/window_event/modal_example_container.js
index 7c16c163800..4247f42e8d1 100644
--- a/src-docs/src/views/window_event/modal_example_container.js
+++ b/src-docs/src/views/window_event/modal_example_container.js
@@ -3,7 +3,7 @@ import { EuiButton } from '../../../../src/components';
import { EuiWindowEvent } from '../../../../src/services';
-export const ModalExample = props => {
+export const ModalExample = (props) => {
const [open, setOpen] = useState(false);
const openModal = () => {
diff --git a/src-docs/src/views/window_event/window_event_conflict.js b/src-docs/src/views/window_event/window_event_conflict.js
index 0975dc996f7..c9c7eb6d099 100644
--- a/src-docs/src/views/window_event/window_event_conflict.js
+++ b/src-docs/src/views/window_event/window_event_conflict.js
@@ -13,13 +13,13 @@ import { keys } from '../../../../src/services';
import { ModalExample } from './modal_example_container';
-const ConflictModal = props => {
+const ConflictModal = (props) => {
const [inputValue, setInputValue] = useState('');
- const updateInputValue = e => {
+ const updateInputValue = (e) => {
setInputValue(e.target.value);
};
- const clearInputValueOnEscape = event => {
+ const clearInputValueOnEscape = (event) => {
if (event.key === keys.ESCAPE) {
setInputValue('');
event.stopPropagation();
diff --git a/src-docs/webpack.config.js b/src-docs/webpack.config.js
index d42383d8d56..a183d629d9a 100644
--- a/src-docs/webpack.config.js
+++ b/src-docs/webpack.config.js
@@ -136,11 +136,11 @@ function getPortSync(options) {
let error = null;
getPort(options)
- .then(port => {
+ .then((port) => {
isDone = true;
freeport = port;
})
- .catch(err => {
+ .catch((err) => {
isDone = true;
error = err;
});
diff --git a/src/components/accessibility/skip_link.test.tsx b/src/components/accessibility/skip_link.test.tsx
index 7aee614cf3d..b834f04fcab 100644
--- a/src/components/accessibility/skip_link.test.tsx
+++ b/src/components/accessibility/skip_link.test.tsx
@@ -52,7 +52,7 @@ describe('EuiSkipLink', () => {
});
describe('position', () => {
- POSITIONS.forEach(position => {
+ POSITIONS.forEach((position) => {
test(`${position} is rendered`, () => {
const component = render(
diff --git a/src/components/accordion/accordion.tsx b/src/components/accordion/accordion.tsx
index 35b854df4f4..6d3ec3c84ef 100644
--- a/src/components/accordion/accordion.tsx
+++ b/src/components/accordion/accordion.tsx
@@ -138,7 +138,7 @@ export class EuiAccordion extends Component<
this.props.onToggle(forceState === 'open' ? false : true);
} else {
this.setState(
- prevState => ({
+ (prevState) => ({
isOpen: !prevState.isOpen,
}),
() => {
@@ -285,14 +285,14 @@ export class EuiAccordion extends Component<
{
+ ref={(node) => {
this.childWrapper = node;
}}
id={id}>
- {resizeRef => (
+ {(resizeRef) => (
{
+ ref={(ref) => {
this.setChildContentRef(ref);
resizeRef(ref);
}}>
diff --git a/src/components/avatar/avatar.test.tsx b/src/components/avatar/avatar.test.tsx
index 8a540d51860..b7f5f4e527a 100644
--- a/src/components/avatar/avatar.test.tsx
+++ b/src/components/avatar/avatar.test.tsx
@@ -48,7 +48,7 @@ describe('EuiAvatar', () => {
});
describe('size', () => {
- SIZES.forEach(size => {
+ SIZES.forEach((size) => {
it(`${size} is rendered`, () => {
const component = render(
);
diff --git a/src/components/badge/badge.test.tsx b/src/components/badge/badge.test.tsx
index d54e6ed84f3..818560f534e 100644
--- a/src/components/badge/badge.test.tsx
+++ b/src/components/badge/badge.test.tsx
@@ -130,7 +130,7 @@ describe('EuiBadge', () => {
});
describe('color', () => {
- COLORS.forEach(color => {
+ COLORS.forEach((color) => {
it(`${color} is rendered`, () => {
const component = render(
Content);
@@ -154,7 +154,7 @@ describe('EuiBadge', () => {
});
describe('iconSide', () => {
- ICON_SIDES.forEach(iconSide => {
+ ICON_SIDES.forEach((iconSide) => {
it(`${iconSide} is rendered`, () => {
const component = render(
@@ -176,7 +176,7 @@ describe('EuiBadge', () => {
expect(component).toMatchSnapshot();
});
- COLORS.forEach(color => {
+ COLORS.forEach((color) => {
it(`is rendered with ${color}`, () => {
const component = render(
diff --git a/src/components/badge/badge_group/badge_group.test.tsx b/src/components/badge/badge_group/badge_group.test.tsx
index 7e1cc6318d7..b44ec30fd1a 100644
--- a/src/components/badge/badge_group/badge_group.test.tsx
+++ b/src/components/badge/badge_group/badge_group.test.tsx
@@ -36,7 +36,7 @@ describe('EuiBadgeGroup', () => {
});
describe('gutterSize', () => {
- GUTTER_SIZES.forEach(size => {
+ GUTTER_SIZES.forEach((size) => {
it(`${size} is rendered`, () => {
const component = render();
diff --git a/src/components/badge/notification_badge/badge_notification.test.tsx b/src/components/badge/notification_badge/badge_notification.test.tsx
index d3a2f5af9a0..ef67e58484c 100644
--- a/src/components/badge/notification_badge/badge_notification.test.tsx
+++ b/src/components/badge/notification_badge/badge_notification.test.tsx
@@ -34,7 +34,7 @@ describe('EuiNotificationBadge', () => {
describe('props', () => {
describe('color', () => {
- COLORS.forEach(color => {
+ COLORS.forEach((color) => {
test(`${color} is rendered`, () => {
const component = render(
5
@@ -46,7 +46,7 @@ describe('EuiNotificationBadge', () => {
});
describe('size', () => {
- SIZES.forEach(size => {
+ SIZES.forEach((size) => {
test(`${size} is rendered`, () => {
const component = render(
5
diff --git a/src/components/basic_table/basic_table.test.tsx b/src/components/basic_table/basic_table.test.tsx
index 37bfa9e0bce..b6aed3048b2 100644
--- a/src/components/basic_table/basic_table.test.tsx
+++ b/src/components/basic_table/basic_table.test.tsx
@@ -151,7 +151,7 @@ describe('EuiBasicTable', () => {
description: 'description',
},
],
- rowProps: item => {
+ rowProps: (item) => {
const { id } = item;
return {
'data-test-subj': `row-${id}`,
diff --git a/src/components/basic_table/basic_table.tsx b/src/components/basic_table/basic_table.tsx
index 92908e24f41..3ada08a1b25 100644
--- a/src/components/basic_table/basic_table.tsx
+++ b/src/components/basic_table/basic_table.tsx
@@ -366,7 +366,7 @@ export class EuiBasicTable extends Component<
'keydown',
'keyup',
'keypress',
- ].forEach(event => {
+ ].forEach((event) => {
tbody.addEventListener(event, listener, true);
this.cleanups.push(() => {
tbody.removeEventListener(event, listener, true);
@@ -375,7 +375,7 @@ export class EuiBasicTable extends Component<
};
private removeLoadingListeners = () => {
- this.cleanups.forEach(cleanup => cleanup());
+ this.cleanups.forEach((cleanup) => cleanup());
this.cleanups.length = 0;
};
@@ -532,9 +532,7 @@ export class EuiBasicTable extends Component<
{this.renderTableMobileSort()}
- ) : (
- undefined
- );
+ ) : undefined;
const caption = this.renderTableCaption();
const head = this.renderTableHead();
const body = this.renderTableBody();
@@ -1040,9 +1038,7 @@ export class EuiBasicTable extends Component<
{itemIdToExpandedRowMap[itemId]}
- ) : (
- undefined
- );
+ ) : undefined;
const { rowProps: rowPropsCallback } = this.props;
const rowProps = getRowProps(item, rowPropsCallback as RowPropsCallback);
@@ -1130,7 +1126,7 @@ export class EuiBasicTable extends Component<
);
if (actualActions.length > 2) {
// if any of the actions `isPrimary`, add them inline as well, but only the first 2
- const primaryActions = actualActions.filter(o => o.isPrimary);
+ const primaryActions = actualActions.filter((o) => o.isPrimary);
actualActions = primaryActions.slice(0, 2);
// if we have more than 1 action, we don't show them all in the cell, instead we
diff --git a/src/components/basic_table/collapsed_item_actions.tsx b/src/components/basic_table/collapsed_item_actions.tsx
index d33c9cb919f..fe31b82cede 100644
--- a/src/components/basic_table/collapsed_item_actions.tsx
+++ b/src/components/basic_table/collapsed_item_actions.tsx
@@ -56,7 +56,7 @@ export class CollapsedItemActions extends Component<
state = { popoverOpen: false };
togglePopover = () => {
- this.setState(prevState => ({ popoverOpen: !prevState.popoverOpen }));
+ this.setState((prevState) => ({ popoverOpen: !prevState.popoverOpen }));
};
closePopover = () => {
diff --git a/src/components/basic_table/default_item_action.test.tsx b/src/components/basic_table/default_item_action.test.tsx
index 6cce1dae8fd..399f7002ba3 100644
--- a/src/components/basic_table/default_item_action.test.tsx
+++ b/src/components/basic_table/default_item_action.test.tsx
@@ -74,7 +74,7 @@ describe('DefaultItemAction', () => {
test('render - name', () => {
const action: EmptyButtonAction- = {
- name: item => {item.id},
+ name: (item) => {item.id},
description: 'action 1',
type: 'button',
onClick: () => {},
diff --git a/src/components/basic_table/expanded_item_actions.test.tsx b/src/components/basic_table/expanded_item_actions.test.tsx
index abdfa253e89..355832bf648 100644
--- a/src/components/basic_table/expanded_item_actions.test.tsx
+++ b/src/components/basic_table/expanded_item_actions.test.tsx
@@ -36,7 +36,7 @@ describe('ExpandedItemActions', () => {
{
name: 'custom1',
description: 'custom 1',
- render: _item => <>>,
+ render: (_item) => <>>,
},
],
itemId: 'xyz',
diff --git a/src/components/basic_table/in_memory_table.test.tsx b/src/components/basic_table/in_memory_table.test.tsx
index 8622f5501a0..0c2512c5ae8 100644
--- a/src/components/basic_table/in_memory_table.test.tsx
+++ b/src/components/basic_table/in_memory_table.test.tsx
@@ -309,7 +309,7 @@ describe('EuiInMemoryTable', () => {
expect(
component
.find('tbody .euiTableCellContent__text')
- .map(cell => cell.text())
+ .map((cell) => cell.text())
).toEqual(['name3', 'name1', 'name2']);
});
@@ -341,7 +341,7 @@ describe('EuiInMemoryTable', () => {
expect(
component
.find('tbody .euiTableCellContent__text')
- .map(cell => cell.text())
+ .map((cell) => cell.text())
).toEqual(['name1', 'name2', 'name3']);
});
@@ -373,7 +373,7 @@ describe('EuiInMemoryTable', () => {
expect(
component
.find('tbody .euiTableCellContent__text')
- .map(cell => cell.text())
+ .map((cell) => cell.text())
).toEqual(['name3', 'name2', 'name1']);
});
@@ -412,7 +412,7 @@ describe('EuiInMemoryTable', () => {
expect(
component
.find('tbody .euiTableCellContent__text')
- .map(cell => cell.text())
+ .map((cell) => cell.text())
).toEqual(['name3', '1', 'name2', '2', 'name1', '3']);
});
@@ -1073,18 +1073,8 @@ describe('EuiInMemoryTable', () => {
component.find('button[data-test-subj="pagination-button-1"][disabled]')
.length
).toBe(1);
- expect(
- component
- .find('td')
- .at(0)
- .text()
- ).toBe('Index2');
- expect(
- component
- .find('td')
- .at(1)
- .text()
- ).toBe('Index3');
+ expect(component.find('td').at(0).text()).toBe('Index2');
+ expect(component.find('td').at(1).text()).toBe('Index3');
// click the first pagination button
component
@@ -1104,18 +1094,8 @@ describe('EuiInMemoryTable', () => {
component.find('button[data-test-subj="pagination-button-1"][disabled]')
.length
).toBe(1);
- expect(
- component
- .find('td')
- .at(0)
- .text()
- ).toBe('Index2');
- expect(
- component
- .find('td')
- .at(1)
- .text()
- ).toBe('Index3');
+ expect(component.find('td').at(0).text()).toBe('Index2');
+ expect(component.find('td').at(1).text()).toBe('Index3');
// re-render with an updated `pageIndex` value
pagination.pageIndex = 2;
@@ -1126,18 +1106,8 @@ describe('EuiInMemoryTable', () => {
component.find('button[data-test-subj="pagination-button-2"][disabled]')
.length
).toBe(1);
- expect(
- component
- .find('td')
- .at(0)
- .text()
- ).toBe('Index4');
- expect(
- component
- .find('td')
- .at(1)
- .text()
- ).toBe('Index5');
+ expect(component.find('td').at(0).text()).toBe('Index4');
+ expect(component.find('td').at(1).text()).toBe('Index5');
});
it('respects pageSize', () => {
@@ -1172,18 +1142,8 @@ describe('EuiInMemoryTable', () => {
// check that the first 2 items rendered
expect(component.find('td').length).toBe(2);
- expect(
- component
- .find('td')
- .at(0)
- .text()
- ).toBe('Index0');
- expect(
- component
- .find('td')
- .at(1)
- .text()
- ).toBe('Index1');
+ expect(component.find('td').at(0).text()).toBe('Index0');
+ expect(component.find('td').at(1).text()).toBe('Index1');
// change the page size
component
@@ -1206,18 +1166,8 @@ describe('EuiInMemoryTable', () => {
// verify still only rendering the first 2 rows
expect(component.find('td').length).toBe(2);
- expect(
- component
- .find('td')
- .at(0)
- .text()
- ).toBe('Index0');
- expect(
- component
- .find('td')
- .at(1)
- .text()
- ).toBe('Index1');
+ expect(component.find('td').at(0).text()).toBe('Index0');
+ expect(component.find('td').at(1).text()).toBe('Index1');
// update the controlled page size
pagination.pageSize = 4;
@@ -1225,30 +1175,10 @@ describe('EuiInMemoryTable', () => {
// verify it now renders 4 rows
expect(component.find('td').length).toBe(4);
- expect(
- component
- .find('td')
- .at(0)
- .text()
- ).toBe('Index0');
- expect(
- component
- .find('td')
- .at(1)
- .text()
- ).toBe('Index1');
- expect(
- component
- .find('td')
- .at(2)
- .text()
- ).toBe('Index2');
- expect(
- component
- .find('td')
- .at(3)
- .text()
- ).toBe('Index3');
+ expect(component.find('td').at(0).text()).toBe('Index0');
+ expect(component.find('td').at(1).text()).toBe('Index1');
+ expect(component.find('td').at(2).text()).toBe('Index2');
+ expect(component.find('td').at(3).text()).toBe('Index3');
});
});
});
diff --git a/src/components/basic_table/in_memory_table.tsx b/src/components/basic_table/in_memory_table.tsx
index 37874efe6df..4f21e6ac37e 100644
--- a/src/components/basic_table/in_memory_table.tsx
+++ b/src/components/basic_table/in_memory_table.tsx
@@ -470,7 +470,7 @@ export class EuiInMemoryTable extends Component<
}
// Reset pagination state.
- this.setState(state => ({
+ this.setState((state) => ({
prevProps: {
...state.prevProps,
search,
diff --git a/src/components/bottom_bar/bottom_bar.test.tsx b/src/components/bottom_bar/bottom_bar.test.tsx
index 9f1f04af41f..f63d9dd82ae 100644
--- a/src/components/bottom_bar/bottom_bar.test.tsx
+++ b/src/components/bottom_bar/bottom_bar.test.tsx
@@ -27,7 +27,7 @@ import { EuiBottomBar, paddingSizeToClassNameMap } from './bottom_bar';
// @ts-ignore TODO: Temporary hack which we can remove once react-test-renderer supports portals.
// More info at https://github.com/facebook/react/issues/11565.
-ReactDOM.createPortal = node => node;
+ReactDOM.createPortal = (node) => node;
describe('EuiBottomBar', () => {
test('is rendered', () => {
@@ -40,7 +40,7 @@ describe('EuiBottomBar', () => {
describe('props', () => {
describe('paddingSize', () => {
- keysOf(paddingSizeToClassNameMap).forEach(paddingSize => {
+ keysOf(paddingSizeToClassNameMap).forEach((paddingSize) => {
test(`${paddingSize} is rendered`, () => {
const component = render();
diff --git a/src/components/bottom_bar/bottom_bar.tsx b/src/components/bottom_bar/bottom_bar.tsx
index 12d33b352bb..bca87790cb1 100644
--- a/src/components/bottom_bar/bottom_bar.tsx
+++ b/src/components/bottom_bar/bottom_bar.tsx
@@ -100,7 +100,7 @@ export class EuiBottomBar extends Component {
landmarkHeading ? landmarkHeading : screenReaderHeading
}
className={classes}
- ref={node => {
+ ref={(node) => {
this.bar = node;
}}
{...rest}>
diff --git a/src/components/button/button.test.tsx b/src/components/button/button.test.tsx
index bcc7c3cd655..63b856e8196 100644
--- a/src/components/button/button.test.tsx
+++ b/src/components/button/button.test.tsx
@@ -85,7 +85,7 @@ describe('EuiButton', () => {
});
describe('color', () => {
- COLORS.forEach(color => {
+ COLORS.forEach((color) => {
test(`${color} is rendered`, () => {
const component = render();
@@ -95,7 +95,7 @@ describe('EuiButton', () => {
});
describe('size', () => {
- SIZES.forEach(size => {
+ SIZES.forEach((size) => {
test(`${size} is rendered`, () => {
const component = render();
@@ -105,7 +105,7 @@ describe('EuiButton', () => {
});
describe('iconSide', () => {
- ICON_SIDES.forEach(iconSide => {
+ ICON_SIDES.forEach((iconSide) => {
test(`${iconSide} is rendered`, () => {
const component = render(
diff --git a/src/components/button/button_content.tsx b/src/components/button/button_content.tsx
index c27ff045f3b..9df9aa6d3a5 100644
--- a/src/components/button/button_content.tsx
+++ b/src/components/button/button_content.tsx
@@ -50,8 +50,9 @@ export interface EuiButtonContentProps extends CommonProps {
textProps?: HTMLAttributes & CommonProps;
}
-export const EuiButtonContent: FunctionComponent = ({
+export const EuiButtonContent: FunctionComponent<
+ EuiButtonContentType & EuiButtonContentProps
+> = ({
children,
textProps,
isLoading = false,
diff --git a/src/components/button/button_empty/button_empty.test.tsx b/src/components/button/button_empty/button_empty.test.tsx
index b885fadc683..23e01d1b8bb 100644
--- a/src/components/button/button_empty/button_empty.test.tsx
+++ b/src/components/button/button_empty/button_empty.test.tsx
@@ -71,7 +71,7 @@ describe('EuiButtonEmpty', () => {
});
describe('color', () => {
- COLORS.forEach(color => {
+ COLORS.forEach((color) => {
test(`${color} is rendered`, () => {
const component = render();
@@ -81,7 +81,7 @@ describe('EuiButtonEmpty', () => {
});
describe('size', () => {
- SIZES.forEach(size => {
+ SIZES.forEach((size) => {
test(`${size} is rendered`, () => {
const component = render();
@@ -91,7 +91,7 @@ describe('EuiButtonEmpty', () => {
});
describe('iconSide', () => {
- ICON_SIDES.forEach(iconSide => {
+ ICON_SIDES.forEach((iconSide) => {
test(`${iconSide} is rendered`, () => {
const component = render(
@@ -105,7 +105,7 @@ describe('EuiButtonEmpty', () => {
});
describe('flush', () => {
- FLUSH_TYPES.forEach(flushType => {
+ FLUSH_TYPES.forEach((flushType) => {
test(`${flushType} is rendered`, () => {
const component = render();
diff --git a/src/components/button/button_group/button_group.test.tsx b/src/components/button/button_group/button_group.test.tsx
index d1fb2c57e31..46ffcba1a43 100644
--- a/src/components/button/button_group/button_group.test.tsx
+++ b/src/components/button/button_group/button_group.test.tsx
@@ -78,7 +78,7 @@ describe('EuiButtonGroup', () => {
});
describe('buttonSize', () => {
- SIZES.forEach(size => {
+ SIZES.forEach((size) => {
test(`${size} is rendered`, () => {
const component = render(
{
});
describe('color', () => {
- COLORS.forEach(color => {
+ COLORS.forEach((color) => {
test(`${color} is rendered`, () => {
const component = render(
{
});
describe('color', () => {
- COLORS.forEach(color => {
+ COLORS.forEach((color) => {
test(`${color} is rendered`, () => {
const component = render(
diff --git a/src/components/call_out/call_out.test.tsx b/src/components/call_out/call_out.test.tsx
index 0c366abefac..64415856332 100644
--- a/src/components/call_out/call_out.test.tsx
+++ b/src/components/call_out/call_out.test.tsx
@@ -52,7 +52,7 @@ describe('EuiCallOut', () => {
});
describe('color', () => {
- COLORS.forEach(color => {
+ COLORS.forEach((color) => {
test(`${color} is rendered`, () => {
const component = render();
@@ -62,7 +62,7 @@ describe('EuiCallOut', () => {
});
describe('heading', () => {
- HEADINGS.forEach(heading => {
+ HEADINGS.forEach((heading) => {
test(`${heading} is rendered`, () => {
const component = render();
diff --git a/src/components/card/card.test.tsx b/src/components/card/card.test.tsx
index 1618a591042..6b38d81f879 100644
--- a/src/components/card/card.test.tsx
+++ b/src/components/card/card.test.tsx
@@ -194,7 +194,7 @@ describe('EuiCard', () => {
});
describe('paddingSize', () => {
- SIZES.forEach(size => {
+ SIZES.forEach((size) => {
test(`${size} is applied`, () => {
const component = render(
= ({
{
+ buttonRef={(node) => {
link = node;
}}
/>
@@ -338,7 +338,7 @@ export const EuiCard: FunctionComponent = ({
target={target}
aria-describedby={`${ariaId}Description`}
rel={getSecureRelForTarget({ href, target, rel })}
- ref={node => {
+ ref={(node) => {
link = node;
}}>
{title}
@@ -351,7 +351,7 @@ export const EuiCard: FunctionComponent = ({
onClick={onClick as React.MouseEventHandler}
disabled={isDisabled}
aria-describedby={`${optionalBetaBadgeID} ${ariaId}Description`}
- ref={node => {
+ ref={(node) => {
link = node;
}}>
{title}
diff --git a/src/components/code/_code_block.tsx b/src/components/code/_code_block.tsx
index 24dd9dc1c52..dd9d1a9ddb4 100644
--- a/src/components/code/_code_block.tsx
+++ b/src/components/code/_code_block.tsx
@@ -216,7 +216,7 @@ export const EuiCodeBlockImpl: FunctionComponent = ({
{(copyButton: string) => (
- {copy => (
+ {(copy) => (
{
});
describe('fontSize', () => {
- FONT_SIZES.forEach(fontSize => {
+ FONT_SIZES.forEach((fontSize) => {
test(`${fontSize} is rendered`, () => {
const component = mount(
{code}
@@ -99,7 +99,7 @@ describe('EuiCodeBlock', () => {
});
describe('paddingSize', () => {
- PADDING_SIZES.forEach(paddingSize => {
+ PADDING_SIZES.forEach((paddingSize) => {
test(`${paddingSize} is rendered`, () => {
const component = mount(
{code}
@@ -112,7 +112,7 @@ describe('EuiCodeBlock', () => {
});
describe('dynamic content', () => {
- it('updates DOM when input changes', done => {
+ it('updates DOM when input changes', (done) => {
expect.assertions(2);
function takeSnapshot() {
diff --git a/src/components/code_editor/code_editor.tsx b/src/components/code_editor/code_editor.tsx
index fb6c7d50aab..00eec161b57 100644
--- a/src/components/code_editor/code_editor.tsx
+++ b/src/components/code_editor/code_editor.tsx
@@ -154,7 +154,7 @@ export class EuiCodeEditor extends Component<
}
};
- onKeyDownHint: KeyboardEventHandler = event => {
+ onKeyDownHint: KeyboardEventHandler = (event) => {
if (event.key === keys.ENTER) {
event.preventDefault();
this.startEditing();
@@ -202,7 +202,7 @@ export class EuiCodeEditor extends Component<
if (el) {
const textarea = el.querySelector('textarea');
if (textarea)
- keysOf(textareaProps).forEach(key => {
+ keysOf(textareaProps).forEach((key) => {
if (textareaProps[key])
textarea.setAttribute(`${key}`, textareaProps[key]!.toString());
});
@@ -261,7 +261,7 @@ export class EuiCodeEditor extends Component<
{
+ ref={(hint) => {
this.editorHint = hint;
}}
tabIndex={0}
diff --git a/src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.test.tsx b/src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.test.tsx
index 0475ad8f020..0ac3cdc93de 100644
--- a/src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.test.tsx
+++ b/src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.test.tsx
@@ -82,7 +82,7 @@ describe('EuiCollapsibleNavGroup', () => {
});
describe('background', () => {
- BACKGROUNDS.forEach(color => {
+ BACKGROUNDS.forEach((color) => {
test(`${color} is rendered`, () => {
const component = render(
diff --git a/src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx b/src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
index f04b054ef8c..d6aa1e531b6 100644
--- a/src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
+++ b/src/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.tsx
@@ -169,9 +169,7 @@ export const EuiCollapsibleNavGroup: FunctionComponent
- ) : (
- undefined
- );
+ ) : undefined;
if (isCollapsible && title) {
return (
diff --git a/src/components/color_picker/color_stops/color_stops.tsx b/src/components/color_picker/color_stops/color_stops.tsx
index 1580743044c..25b1c7f7cf9 100644
--- a/src/components/color_picker/color_stops/color_stops.tsx
+++ b/src/components/color_picker/color_stops/color_stops.tsx
@@ -90,7 +90,7 @@ function sortStops(colorStops: ColorStop[]) {
}
function getValidStops(colorStops: ColorStop[]) {
- return colorStops.map(el => el.stop).filter(stop => !isNaN(stop));
+ return colorStops.map((el) => el.stop).filter((stop) => !isNaN(stop));
}
function getRangeMin(colorStops: ColorStop[], min?: number) {
@@ -217,7 +217,7 @@ export const EuiColorStops: FunctionComponent = ({
useEffect(() => {
if (focusStopOnUpdate !== null) {
const toFocusIndex = sortedStops
- .map(el => el.stop)
+ .map((el) => el.stop)
.indexOf(focusStopOnUpdate);
const toFocusId = toFocusIndex > -1 ? sortedStops[toFocusIndex].id : null;
onFocusStop(toFocusIndex);
@@ -378,7 +378,7 @@ export const EuiColorStops: FunctionComponent = ({
onRemove={
sortedStops.length > 1 ? () => onRemove(colorStop.id) : undefined
}
- onChange={stop => handleStopChange(stop, colorStop.id)}
+ onChange={(stop) => handleStopChange(stop, colorStop.id)}
onFocus={() => setFocusedStopIndex(index)}
parentRef={wrapperRef}
colorPickerMode={mode}
@@ -386,9 +386,9 @@ export const EuiColorStops: FunctionComponent = ({
colorPickerSwatches={swatches}
disabled={disabled}
readOnly={readOnly}
- aria-valuetext={`Stop: ${colorStop.stop}, Color: ${
- colorStop.color
- } (${index + 1} of ${colorStops.length})`}
+ aria-valuetext={`Stop: ${colorStop.stop}, Color: ${colorStop.color} (${
+ index + 1
+ } of ${colorStops.length})`}
isPopoverOpen={colorStop.id === openedStopId}
openPopover={() => {
setOpenedStopId(colorStop.id);
diff --git a/src/components/color_picker/color_stops/utils.ts b/src/components/color_picker/color_stops/utils.ts
index 087dfbecb7a..3e0eb5d832d 100644
--- a/src/components/color_picker/color_stops/utils.ts
+++ b/src/components/color_picker/color_stops/utils.ts
@@ -49,7 +49,7 @@ export const addStop = (
max: number
) => {
const index = colorStops.length ? colorStops.length - 1 : 0;
- const stops = colorStops.map(el => el.stop);
+ const stops = colorStops.map((el) => el.stop);
const currentStop = stops[index] != null ? stops[index] : max;
let delta = 1;
if (index !== 0) {
@@ -91,7 +91,7 @@ export const isInvalid = (
colorStops: ColorStop[],
showAlpha: boolean = false
) => {
- return colorStops.some(colorStop => {
+ return colorStops.some((colorStop) => {
return (
isColorInvalid(colorStop.color, showAlpha) ||
isStopInvalid(colorStop.stop)
diff --git a/src/components/color_picker/utils.ts b/src/components/color_picker/utils.ts
index 065e6397c20..e214ee619e0 100644
--- a/src/components/color_picker/utils.ts
+++ b/src/components/color_picker/utils.ts
@@ -118,7 +118,7 @@ export const parseColor = (input?: string | null) => {
const rgb = input
.trim()
.split(',')
- .filter(n => n !== '')
+ .filter((n) => n !== '')
.map(Number);
parsed = rgb.length > 2 && rgb.length < 5 ? rgb : HEX_FALLBACK;
} else {
diff --git a/src/components/combo_box/combo_box.tsx b/src/components/combo_box/combo_box.tsx
index 22ffeb4fa9a..ebe581b1ce7 100644
--- a/src/components/combo_box/combo_box.tsx
+++ b/src/components/combo_box/combo_box.tsx
@@ -227,7 +227,7 @@ export class EuiComboBox extends Component<
// Refs
comboBoxRefInstance: RefInstance = null;
- comboBoxRefCallback: RefCallback = ref => {
+ comboBoxRefCallback: RefCallback = (ref) => {
// IE11 doesn't support the `relatedTarget` event property for blur events
// but does add it for focusout. React doesn't support `onFocusOut` so here we are.
if (this.comboBoxRefInstance) {
@@ -251,20 +251,20 @@ export class EuiComboBox extends Component<
}
};
autoSizeInputRefInstance: RefInstance = null;
- autoSizeInputRefCallback: RefCallback<
- AutosizeInput & HTMLDivElement
- > = ref => {
+ autoSizeInputRefCallback: RefCallback = (
+ ref
+ ) => {
this.autoSizeInputRefInstance = ref;
};
searchInputRefInstance: RefInstance = null;
- searchInputRefCallback: RefCallback = ref => {
+ searchInputRefCallback: RefCallback = (ref) => {
this.searchInputRefInstance = ref;
if (this.props.inputRef) this.props.inputRef(ref);
};
listRefInstance: RefInstance = null;
- listRefCallback: RefCallback = ref => {
+ listRefCallback: RefCallback = (ref) => {
if (this.comboBoxRefInstance) {
// find the zIndex of the combobox relative to the page body
// and use that to depth-position the list box
@@ -279,9 +279,9 @@ export class EuiComboBox extends Component<
toggleButtonRefInstance: RefInstance<
HTMLButtonElement | HTMLSpanElement
> = null;
- toggleButtonRefCallback: RefCallback<
- HTMLButtonElement | HTMLSpanElement
- > = ref => {
+ toggleButtonRefCallback: RefCallback = (
+ ref
+ ) => {
this.toggleButtonRefInstance = ref;
};
@@ -352,8 +352,9 @@ export class EuiComboBox extends Component<
// listElement doesn't have its width set until after updating the position
// which means the popover service won't know about the correct width
// however, we already know where to position the element
- this.listRefInstance.style.left = `${comboBoxBounds.left +
- window.pageXOffset}px`;
+ this.listRefInstance.style.left = `${
+ comboBoxBounds.left + window.pageXOffset
+ }px`;
this.listRefInstance.style.width = `${comboBoxBounds.width}px`;
}
@@ -508,7 +509,7 @@ export class EuiComboBox extends Component<
return false;
}
- const flattenOptions = flattenOptionGroups(options).map(option => {
+ const flattenOptions = flattenOptionGroups(options).map((option) => {
return { ...option, label: option.label.trim().toLowerCase() };
});
@@ -516,7 +517,8 @@ export class EuiComboBox extends Component<
selectedOptions.forEach(({ label }) => {
const trimmedLabel = label.trim().toLowerCase();
if (
- flattenOptions.findIndex(option => option.label === trimmedLabel) !== -1
+ flattenOptions.findIndex((option) => option.label === trimmedLabel) !==
+ -1
)
numberOfSelectedOptions += 1;
});
@@ -524,7 +526,7 @@ export class EuiComboBox extends Component<
return flattenOptions.length === numberOfSelectedOptions;
};
- onComboBoxFocus: FocusEventHandler = event => {
+ onComboBoxFocus: FocusEventHandler = (event) => {
if (this.props.onFocus) {
this.props.onFocus(event);
}
@@ -546,7 +548,7 @@ export class EuiComboBox extends Component<
}
};
- onContainerBlur: EventListener = event => {
+ onContainerBlur: EventListener = (event) => {
// close the options list, unless the use clicked on an option
/**
@@ -586,7 +588,7 @@ export class EuiComboBox extends Component<
}
};
- onKeyDown: KeyboardEventHandler = event => {
+ onKeyDown: KeyboardEventHandler = (event) => {
switch (event.key) {
case keys.ARROW_UP:
event.preventDefault();
@@ -645,11 +647,11 @@ export class EuiComboBox extends Component<
}
};
- onOptionEnterKey: OptionHandler = option => {
+ onOptionEnterKey: OptionHandler = (option) => {
this.onAddOption(option);
};
- onOptionClick: OptionHandler = option => {
+ onOptionClick: OptionHandler = (option) => {
this.onAddOption(option);
};
@@ -693,10 +695,10 @@ export class EuiComboBox extends Component<
}
};
- onRemoveOption: OptionHandler = removedOption => {
+ onRemoveOption: OptionHandler = (removedOption) => {
const { onChange, selectedOptions } = this.props;
if (onChange) {
- onChange(selectedOptions.filter(option => option !== removedOption));
+ onChange(selectedOptions.filter((option) => option !== removedOption));
}
this.clearActiveOption();
@@ -731,7 +733,7 @@ export class EuiComboBox extends Component<
this.props.selectedOptions.length === 1
) {
const selectedOptionIndex = this.state.matchingOptions.findIndex(
- option =>
+ (option) =>
option.label === this.props.selectedOptions[0].label &&
option.key === this.props.selectedOptions[0].key
);
@@ -762,9 +764,9 @@ export class EuiComboBox extends Component<
this.closeList();
};
- onSearchChange: NonNullable<
- EuiComboBoxInputProps['onChange']
- > = searchValue => {
+ onSearchChange: NonNullable['onChange']> = (
+ searchValue
+ ) => {
const { onSearchChange, delimiter } = this.props;
if (onSearchChange) {
@@ -953,7 +955,7 @@ export class EuiComboBox extends Component<
});
const value = selectedOptions
- .map(selectedOption => selectedOption.label)
+ .map((selectedOption) => selectedOption.label)
.join(', ');
let optionsList;
diff --git a/src/components/combo_box/combo_box_input/combo_box_input.tsx b/src/components/combo_box/combo_box_input/combo_box_input.tsx
index 8f77b8e203e..01d1c14d55f 100644
--- a/src/components/combo_box/combo_box_input/combo_box_input.tsx
+++ b/src/components/combo_box/combo_box_input/combo_box_input.tsx
@@ -93,14 +93,14 @@ export class EuiComboBoxInput extends Component<
});
};
- onFocus: FocusEventHandler = event => {
+ onFocus: FocusEventHandler = (event) => {
this.props.onFocus(event);
this.setState({
hasFocus: true,
});
};
- onBlur: FocusEventHandler = event => {
+ onBlur: FocusEventHandler = (event) => {
if (this.props.onBlur) {
this.props.onBlur(event);
}
@@ -119,7 +119,7 @@ export class EuiComboBoxInput extends Component<
}
}
- inputOnChange: ChangeEventHandler = event => {
+ inputOnChange: ChangeEventHandler = (event) => {
const { onChange, searchValue } = this.props;
if (onChange) {
onChange(event.target.value as typeof searchValue);
@@ -169,7 +169,7 @@ export class EuiComboBoxInput extends Component<
false;
const pills = selectedOptions
- ? selectedOptions.map(option => {
+ ? selectedOptions.map((option) => {
const { key, label, color, onClick, ...rest } = option;
const pillOnClose =
isDisabled || singleSelection || onClick
diff --git a/src/components/combo_box/combo_box_options_list/combo_box_option.tsx b/src/components/combo_box/combo_box_options_list/combo_box_option.tsx
index 8f09a87ee08..097e9353b8d 100644
--- a/src/components/combo_box/combo_box_options_list/combo_box_option.tsx
+++ b/src/components/combo_box/combo_box_options_list/combo_box_option.tsx
@@ -54,7 +54,7 @@ export class EuiComboBoxOption extends Component> {
onClick(option);
};
- onKeyDown: KeyboardEventHandler = event => {
+ onKeyDown: KeyboardEventHandler = (event) => {
if (event.key === keys.ENTER || event.key === keys.SPACE) {
event.preventDefault();
event.stopPropagation();
diff --git a/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx b/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx
index 7f0efa491df..ed287d8e8ea 100644
--- a/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx
+++ b/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx
@@ -192,7 +192,7 @@ export class EuiComboBoxOptionsList extends Component<
}
};
- listRefCallback: RefCallback = ref => {
+ listRefCallback: RefCallback = (ref) => {
this.props.listRef(ref);
this.listRefInstance = ref;
};
@@ -442,9 +442,7 @@ export class EuiComboBoxOptionsList extends Component<
{emptyStateContent}
- ) : (
- undefined
- );
+ ) : undefined;
const numVisibleOptions =
matchingOptions.length < 7 ? matchingOptions.length : 7;
diff --git a/src/components/combo_box/matching_options.ts b/src/components/combo_box/matching_options.ts
index d2f6340916f..35550c86f61 100644
--- a/src/components/combo_box/matching_options.ts
+++ b/src/components/combo_box/matching_options.ts
@@ -45,7 +45,7 @@ export const getSelectedOptionForSearchValue = (
) => {
const normalizedSearchValue = searchValue.toLowerCase();
return selectedOptions.find(
- option =>
+ (option) =>
option.label.toLowerCase() === normalizedSearchValue &&
(!optionKey || option.key === optionKey)
);
@@ -97,7 +97,7 @@ export const getMatchingOptions = (
const normalizedSearchValue = searchValue.trim().toLowerCase();
const matchingOptions: Array> = [];
- options.forEach(option => {
+ options.forEach((option) => {
if (option.options) {
const matchingOptionsForGroup: Array> = [];
option.options.forEach((groupOption: EuiComboBoxOptionOption) => {
@@ -138,7 +138,7 @@ export const getMatchingOptions = (
others: Array>;
} = { startWith: [], others: [] };
- matchingOptions.forEach(object => {
+ matchingOptions.forEach((object) => {
if (object.label.toLowerCase().startsWith(normalizedSearchValue)) {
refObj.startWith.push(object);
} else {
diff --git a/src/components/comment_list/comment_event.tsx b/src/components/comment_list/comment_event.tsx
index a257f511595..1826ea1d4b7 100644
--- a/src/components/comment_list/comment_event.tsx
+++ b/src/components/comment_list/comment_event.tsx
@@ -84,21 +84,15 @@ export const EuiCommentEvent: FunctionComponent = ({
- ) : (
- undefined
- )}
+ ) : undefined}
{actions ? (
{actions}
- ) : (
- undefined
- )}
+ ) : undefined}
{children ? (
{children}
- ) : (
- undefined
- )}
+ ) : undefined}
);
};
diff --git a/src/components/context_menu/context_menu.test.tsx b/src/components/context_menu/context_menu.test.tsx
index bade66c35d7..8eaad16417f 100644
--- a/src/components/context_menu/context_menu.test.tsx
+++ b/src/components/context_menu/context_menu.test.tsx
@@ -75,7 +75,7 @@ const panel0 = {
const panels = [panel0, panel1, panel2, panel3];
export const tick = (ms = 0) =>
- new Promise(resolve => {
+ new Promise((resolve) => {
setTimeout(resolve, ms);
});
diff --git a/src/components/context_menu/context_menu.tsx b/src/components/context_menu/context_menu.tsx
index fa87b807ce2..cb19ad796c2 100644
--- a/src/components/context_menu/context_menu.tsx
+++ b/src/components/context_menu/context_menu.tsx
@@ -81,7 +81,7 @@ const isItemSeparator = (
function mapIdsToPanels(panels: EuiContextMenuPanelDescriptor[]) {
const map: { [id: string]: EuiContextMenuPanelDescriptor } = {};
- panels.forEach(panel => {
+ panels.forEach((panel) => {
map[panel.id] = panel;
});
@@ -91,9 +91,9 @@ function mapIdsToPanels(panels: EuiContextMenuPanelDescriptor[]) {
function mapIdsToPreviousPanels(panels: EuiContextMenuPanelDescriptor[]) {
const idToPreviousPanelIdMap: { [panel: string]: EuiContextMenuPanelId } = {};
- panels.forEach(panel => {
+ panels.forEach((panel) => {
if (Array.isArray(panel.items)) {
- panel.items.forEach(item => {
+ panel.items.forEach((item) => {
if (isItemSeparator(item)) return;
const isCloseable = item.panel !== undefined;
if (isCloseable) {
@@ -111,7 +111,7 @@ function mapPanelItemsToPanels(panels: EuiContextMenuPanelDescriptor[]) {
[id: string]: { [index: string]: EuiContextMenuPanelId };
} = {};
- panels.forEach(panel => {
+ panels.forEach((panel) => {
idAndItemIndexToPanelIdMap[panel.id] = {};
if (panel.items) {
@@ -246,7 +246,7 @@ export class EuiContextMenu extends Component {
// Set focus on the item which shows the panel we're leaving.
const previousPanel = this.state.idToPanelMap[previousPanelId];
const focusedItemIndex = previousPanel.items!.findIndex(
- item =>
+ (item) =>
!isItemSeparator(item) && item.panel === this.state.incomingPanelId
);
@@ -288,7 +288,7 @@ export class EuiContextMenu extends Component {
const idToRenderedItemsMap: { [id: string]: ReactElement[] } = {};
// Pre-rendering the items lets us check reference equality inside of EuiContextMenuPanel.
- panels.forEach(panel => {
+ panels.forEach((panel) => {
idToRenderedItemsMap[panel.id] = this.renderItems(panel.items);
});
diff --git a/src/components/context_menu/context_menu_panel.tsx b/src/components/context_menu/context_menu_panel.tsx
index 6961aec546b..e6c261c4201 100644
--- a/src/components/context_menu/context_menu_panel.tsx
+++ b/src/components/context_menu/context_menu_panel.tsx
@@ -302,7 +302,7 @@ export class EuiContextMenuPanel extends Component {
// Create fingerprint of all item's watched properties
if (items.length && watchedItemProps && watchedItemProps.length) {
return JSON.stringify(
- items.map(item => {
+ items.map((item) => {
// Create object of item properties and values
const props: any = {
key: item.key,
@@ -433,7 +433,7 @@ export class EuiContextMenuPanel extends Component {
className="euiContextMenuPanelTitle"
type="button"
onClick={onClose}
- ref={node => {
+ ref={(node) => {
this.backButton = node;
}}
data-test-subj="contextMenuPanelTitleButton">
@@ -492,7 +492,7 @@ export class EuiContextMenuPanel extends Component {
this.updateHeight()}>
- {resizeRef => {content}
}
+ {(resizeRef) => {content}
}
diff --git a/src/components/control_bar/control_bar.tsx b/src/components/control_bar/control_bar.tsx
index 17595544dec..4db7960696a 100644
--- a/src/components/control_bar/control_bar.tsx
+++ b/src/components/control_bar/control_bar.tsx
@@ -412,7 +412,7 @@ export class EuiControlBar extends Component<
@@ -448,7 +448,7 @@ export class EuiControlBar extends Component<
{
+ ref={(node) => {
this.bar = node;
}}>
{controls.map((control, index) => controlItem(control, index))}
diff --git a/src/components/copy/copy.test.tsx b/src/components/copy/copy.test.tsx
index 24b14f18319..2015f6523ba 100644
--- a/src/components/copy/copy.test.tsx
+++ b/src/components/copy/copy.test.tsx
@@ -26,7 +26,7 @@ describe('EuiCopy', () => {
test('is rendered', () => {
const component = shallow(
- {copy => }
+ {(copy) => }
);
expect(component).toMatchSnapshot();
@@ -36,7 +36,7 @@ describe('EuiCopy', () => {
test('beforeMessage', () => {
const component = shallow(
- {copy => }
+ {(copy) => }
);
expect(component.state('tooltipText')).toBe('copy this');
@@ -45,7 +45,7 @@ describe('EuiCopy', () => {
test('afterMessage', () => {
const component = shallow
(
- {copy => }
+ {(copy) => }
);
const instance = component.instance();
diff --git a/src/components/datagrid/column_actions.tsx b/src/components/datagrid/column_actions.tsx
index fe942b30a5c..996ebc7cfbc 100644
--- a/src/components/datagrid/column_actions.tsx
+++ b/src/components/datagrid/column_actions.tsx
@@ -32,10 +32,10 @@ export function getColumnActions(
if (column.actions === false) {
return [];
}
- const colIdx = columns.findIndex(col => col.id === column.id);
+ const colIdx = columns.findIndex((col) => col.id === column.id);
const sortingIdx = sorting
- ? sorting.columns.findIndex(col => col.id === column.id)
+ ? sorting.columns.findIndex((col) => col.id === column.id)
: -1;
const sortBy = (direction: 'asc' | 'desc' = 'asc') => {
if (!sorting) {
@@ -75,7 +75,7 @@ export function getColumnActions(
};
const onClickHideColumn = () =>
setVisibleColumns(
- columns.filter(col => col.id !== column.id).map(col => col.id)
+ columns.filter((col) => col.id !== column.id).map((col) => col.id)
);
const onClickSortAsc = () => {
@@ -201,7 +201,7 @@ export function getColumnActions(
//wrap EuiListGroupItem onClick function to close the popover and prevet bubbling up
- return allActions.map(action => {
+ return allActions.map((action) => {
return {
...action,
...{
diff --git a/src/components/datagrid/column_selector.tsx b/src/components/datagrid/column_selector.tsx
index b282e31169c..1c8b61223ac 100644
--- a/src/components/datagrid/column_selector.tsx
+++ b/src/components/datagrid/column_selector.tsx
@@ -89,7 +89,7 @@ export const useColumnSelector = (
function setColumns(nextColumns: string[]) {
setSortedColumns(nextColumns);
- const nextVisibleColumns = nextColumns.filter(id =>
+ const nextVisibleColumns = nextColumns.filter((id) =>
visibleColumnIds.has(id)
);
setVisibleColumns(nextVisibleColumns);
@@ -117,7 +117,7 @@ export const useColumnSelector = (
});
const filteredColumns = sortedColumns.filter(
- id => id.toLowerCase().indexOf(columnSearchText.toLowerCase()) !== -1
+ (id) => id.toLowerCase().indexOf(columnSearchText.toLowerCase()) !== -1
);
const isDragEnabled = allowColumnReorder && columnSearchText.length === 0; // only allow drag-and-drop when not filtering columns
@@ -201,8 +201,10 @@ export const useColumnSelector = (
isDragDisabled={!isDragEnabled}>
{(provided, state) => (
+ className={`euiDataGridColumnSelector__item ${
+ state.isDragging &&
+ 'euiDataGridColumnSelector__item-isDragging'
+ }`}>
{allowColumnHiding ? (
@@ -212,12 +214,12 @@ export const useColumnSelector = (
checked={visibleColumnIds.has(id)}
compressed
className="euiSwitch--mini"
- onChange={event => {
+ onChange={(event) => {
const {
target: { checked },
} = event;
const nextVisibleColumns = sortedColumns.filter(
- columnId =>
+ (columnId) =>
checked
? visibleColumnIds.has(columnId) ||
id === columnId
@@ -280,12 +282,12 @@ export const useColumnSelector = (
() =>
visibleColumns
.map(
- columnId =>
+ (columnId) =>
availableColumns.find(
({ id }) => id === columnId
) as EuiDataGridColumn // cast to avoid `undefined`, it filters those out next
)
- .filter(column => column != null),
+ .filter((column) => column != null),
[availableColumns, visibleColumns]
);
/**
diff --git a/src/components/datagrid/column_sorting_draggable.tsx b/src/components/datagrid/column_sorting_draggable.tsx
index 92631a62396..de9517d69c3 100644
--- a/src/components/datagrid/column_sorting_draggable.tsx
+++ b/src/components/datagrid/column_sorting_draggable.tsx
@@ -97,8 +97,9 @@ export const EuiDataGridColumnSortingDraggable: FunctionComponent
{(provided, state) => (
+ className={`euiDataGridColumnSorting__item ${
+ state.isDragging && 'euiDataGridColumnSorting__item-isDragging'
+ }`}>
{
);
expect(
- component.find('.euiDataGridRowCell').map(cell => {
+ component.find('.euiDataGridRowCell').map((cell) => {
const props = cell.props();
delete props.children;
return props;
@@ -790,7 +790,7 @@ Array [
const gridCellClassNames = component
.find('[className*="euiDataGridRowCell--"]')
- .map(x => x.props().className);
+ .map((x) => x.props().className);
expect(gridCellClassNames).toMatchInlineSnapshot(`
Array [
"euiDataGridRowCell euiDataGridRowCell--numeric",
@@ -828,7 +828,7 @@ Array [
const gridCellClassNames = component
.find('[className~="euiDataGridRowCell"]')
- .map(x => x.props().className);
+ .map((x) => x.props().className);
expect(gridCellClassNames).toMatchInlineSnapshot(`
Array [
"euiDataGridRowCell euiDataGridRowCell--numeric",
@@ -860,7 +860,7 @@ Array [
const gridCellClassNames = component
.find('[className~="euiDataGridRowCell"]')
- .map(x => x.props().className);
+ .map((x) => x.props().className);
expect(gridCellClassNames).toMatchInlineSnapshot(`
Array [
"euiDataGridRowCell euiDataGridRowCell--numeric",
@@ -884,7 +884,7 @@ Array [
const component = mount(
({ id }))}
+ columns={Object.keys(values).map((id) => ({ id }))}
columnVisibility={{
visibleColumns: Object.keys(values),
setVisibleColumns: () => {},
@@ -897,7 +897,7 @@ Array [
const gridCellClassNames = component
.find('[className~="euiDataGridRowCell"]')
- .map(x => x.props().className);
+ .map((x) => x.props().className);
expect(gridCellClassNames).toMatchInlineSnapshot(`
Array [
"euiDataGridRowCell euiDataGridRowCell--numeric",
@@ -919,7 +919,7 @@ Array [
const component = mount(
({ id }))}
+ columns={Object.keys(values).map((id) => ({ id }))}
columnVisibility={{
visibleColumns: Object.keys(values),
setVisibleColumns: () => {},
@@ -946,7 +946,7 @@ Array [
const gridCellClassNames = component
.find('[className~="euiDataGridRowCell"]')
- .map(x => x.props().className);
+ .map((x) => x.props().className);
expect(gridCellClassNames).toMatchInlineSnapshot(`
Array [
"euiDataGridRowCell euiDataGridRowCell--numeric",
@@ -1036,7 +1036,7 @@ Array [
pageIndex: 0,
pageSize: 3,
pageSizeOptions: [3, 6, 10],
- onChangePage: jest.fn(pageIndex => {
+ onChangePage: jest.fn((pageIndex) => {
const pagination = component.props().pagination;
component.setProps({
pagination: { ...pagination, pageIndex },
@@ -1097,7 +1097,7 @@ Array [
pageIndex: 0,
pageSize: 3,
pageSizeOptions: [3, 6, 10],
- onChangePage: jest.fn(pageIndex => {
+ onChangePage: jest.fn((pageIndex) => {
const pagination = component.props().pagination;
component.setProps({
pagination: { ...pagination, pageIndex },
@@ -1162,7 +1162,7 @@ Array [
pageSize: 3,
pageSizeOptions: [3, 6, 10],
onChangePage: jest.fn(),
- onChangeItemsPerPage: jest.fn(pageSize => {
+ onChangeItemsPerPage: jest.fn((pageSize) => {
const pagination = component.props().pagination;
component.setProps({
pagination: { ...pagination, pageSize },
@@ -1276,7 +1276,7 @@ Array [
}}
rowCount={3}
renderCellValue={() => 'value'}
- onColumnResize={args => onColumnResizeCallback(args)}
+ onColumnResize={(args) => onColumnResizeCallback(args)}
/>
);
@@ -1435,7 +1435,7 @@ Array [
describe('column sorting', () => {
it('calls the onSort callback', () => {
- const onSort = jest.fn(columns => {
+ const onSort = jest.fn((columns) => {
component.setProps({ sorting: { columns, onSort } });
component.update();
});
@@ -1540,7 +1540,7 @@ Array [
});
it('sorts in response to user interaction', () => {
- const onSort = jest.fn(columns => {
+ const onSort = jest.fn((columns) => {
component.setProps({ sorting: { columns, onSort } });
component.update();
});
@@ -1597,7 +1597,7 @@ Array [
});
it('sorts with all digit groups in numerical-like', () => {
- const onSort = jest.fn(columns => {
+ const onSort = jest.fn((columns) => {
component.setProps({ sorting: { columns, onSort } });
component.update();
});
@@ -1737,7 +1737,7 @@ Array [
expect(
popover
.find('.euiDataGridColumnSelector__item')
- .map(item => item.text())
+ .map((item) => item.text())
).toEqual(['A', 'B']);
closeColumnSelector(component);
@@ -1755,7 +1755,7 @@ Array [
expect(
popover
.find('.euiDataGridColumnSelector__item')
- .map(item => item.text())
+ .map((item) => item.text())
).toEqual(['A', 'C']);
closeColumnSelector(component);
});
@@ -1786,7 +1786,7 @@ Array [
expect(
popover
.find('.euiDataGridColumnSorting__field')
- .map(item => item.text())
+ .map((item) => item.text())
).toEqual(['A', 'B']);
closeColumnSorterSelection(component);
closeColumnSorter(component);
@@ -1806,7 +1806,7 @@ Array [
expect(
popover
.find('.euiDataGridColumnSorting__field')
- .map(item => item.text())
+ .map((item) => item.text())
).toEqual(['A', 'C']);
closeColumnSorterSelection(component);
closeColumnSorter(component);
@@ -2140,9 +2140,7 @@ Array [
focusableCell.find('[data-test-subj="cell-content"]').text()
).toEqual('0, A');
- findTestSubject(component, 'dataGridRowCell')
- .at(3)
- .simulate('focus');
+ findTestSubject(component, 'dataGridRowCell').at(3).simulate('focus');
focusableCell = getFocusableCell(component);
expect(focusableCell.length).toEqual(1);
diff --git a/src/components/datagrid/data_grid.tsx b/src/components/datagrid/data_grid.tsx
index d51b72c6fba..505bd4070df 100644
--- a/src/components/datagrid/data_grid.tsx
+++ b/src/components/datagrid/data_grid.tsx
@@ -431,7 +431,7 @@ function useInMemoryValues(
const nextInMemoryValues = _inMemoryValues.current;
nextInMemoryValues[rowIndex] = nextInMemoryValues[rowIndex] || {};
nextInMemoryValues[rowIndex][columnId] = value;
- setInMemoryValuesVersion(version => version + 1);
+ setInMemoryValuesVersion((version) => version + 1);
}, []);
// if `inMemory.level` or `rowCount` changes reset the values
@@ -446,7 +446,7 @@ function useInMemoryValues(
for (let i = rowCount; i < existingRowKeyCount; i++) {
delete _inMemoryValues.current[i];
}
- setInMemoryValuesVersion(version => version + 1);
+ setInMemoryValuesVersion((version) => version + 1);
}
}, [inMemoryLevel, rowCount]);
@@ -584,7 +584,7 @@ const useFocus = (
}
: {
tabIndex: 0,
- onFocus: e => {
+ onFocus: (e) => {
// if e.target (the source element of the `focus event`
// matches e.currentTarget (always the div with this onFocus listener)
// then the user has focused directly on the data grid wrapper (almost definitely by tabbing)
@@ -626,7 +626,7 @@ function checkOrDefaultToolBarDiplayOptions<
}
const emptyArrayDefault: EuiDataGridControlColumn[] = [];
-export const EuiDataGrid: FunctionComponent = props => {
+export const EuiDataGrid: FunctionComponent = (props) => {
const [isFullScreen, setIsFullScreen] = useState(false);
const [hasRoomForGridControls, setHasRoomForGridControls] = useState(true);
const [containerRef, _setContainerRef] = useState(
@@ -635,14 +635,14 @@ export const EuiDataGrid: FunctionComponent = props => {
const [interactiveCellId] = useState(htmlIdGenerator()());
const [headerIsInteractive, setHeaderIsInteractive] = useState(false);
- const setContainerRef = useCallback(ref => _setContainerRef(ref), []);
+ const setContainerRef = useCallback((ref) => _setContainerRef(ref), []);
const [wrappingDivFocusProps, focusedCell, setFocusedCell] = useFocus(
headerIsInteractive
);
const handleHeaderChange = useCallback<(headerRow: HTMLElement) => void>(
- headerRow => {
+ (headerRow) => {
const tabbables = tabbable(headerRow);
const managed = headerRow.querySelectorAll('[data-euigrid-tab-managed]');
const hasInteractives = tabbables.length > 0 || managed.length > 0;
@@ -659,7 +659,7 @@ export const EuiDataGrid: FunctionComponent = props => {
[headerIsInteractive, setHeaderIsInteractive, focusedCell, setFocusedCell]
);
const handleHeaderMutation = useCallback(
- records => {
+ (records) => {
const [{ target }] = records;
// find the wrapping header div
@@ -712,7 +712,7 @@ export const EuiDataGrid: FunctionComponent = props => {
// enables/disables grid controls based on available width
const onResize = useOnResize(
- nextHasRoomForGridControls => {
+ (nextHasRoomForGridControls) => {
if (nextHasRoomForGridControls !== hasRoomForGridControls) {
setHasRoomForGridControls(nextHasRoomForGridControls);
}
@@ -1013,7 +1013,7 @@ export const EuiDataGrid: FunctionComponent = props => {
) : null}
- {resizeRef => (
+ {(resizeRef) => (
= props => {
childList: true,
}}
onMutation={handleHeaderMutation}>
- {ref => (
+ {(ref) => (
= (
- a,
- b,
- direction
-) => {
+const defaultComparator: NonNullable<
+ EuiDataGridSchemaDetector['comparator']
+> = (a, b, direction) => {
if (a < b) return direction === 'asc' ? -1 : 1;
if (a > b) return direction === 'asc' ? 1 : -1;
return 0;
@@ -93,7 +91,9 @@ const providedPopoverContents: EuiDataGridPopoverContents = {
},
};
-export const EuiDataGridBody: FunctionComponent = props => {
+export const EuiDataGridBody: FunctionComponent = (
+ props
+) => {
const {
columnWidths,
defaultColumnWidth,
diff --git a/src/components/datagrid/data_grid_cell.tsx b/src/components/datagrid/data_grid_cell.tsx
index 0467bf46d63..bc168ecb23c 100644
--- a/src/components/datagrid/data_grid_cell.tsx
+++ b/src/components/datagrid/data_grid_cell.tsx
@@ -103,10 +103,12 @@ export type EuiDataGridCellValueProps = Omit<
'width' | 'isFocused' | 'interactiveCellId' | 'onCellFocus' | 'popoverContent'
>;
-const EuiDataGridCellContent: FunctionComponent = memo(props => {
+const EuiDataGridCellContent: FunctionComponent<
+ EuiDataGridCellValueProps & {
+ setCellProps: EuiDataGridCellValueElementProps['setCellProps'];
+ isExpanded: boolean;
+ }
+> = memo((props) => {
const { renderCellValue, ...rest } = props;
// React is more permissible than the TS types indicate
@@ -440,7 +442,7 @@ export class EuiDataGridCell extends Component<
- {mutationRef => {
+ {(mutationRef) => {
return (
- {mutationRef => {
+ {(mutationRef) => {
return (
(this.popoverPanelRef.current = ref)}
+ panelRef={(ref) => (this.popoverPanelRef.current = ref)}
ownFocus
panelClassName="euiDataGridRowCell__popover"
zIndex={8001}
display="block"
closePopover={() => this.setState({ popoverIsOpen: false })}
- onKeyDown={event => {
+ onKeyDown={(event) => {
if (event.key === keys.F2 || event.key === keys.ESCAPE) {
event.preventDefault();
event.stopPropagation();
diff --git a/src/components/datagrid/data_grid_control_header_cell.tsx b/src/components/datagrid/data_grid_control_header_cell.tsx
index 3c4288b3704..d8af548fda8 100644
--- a/src/components/datagrid/data_grid_control_header_cell.tsx
+++ b/src/components/datagrid/data_grid_control_header_cell.tsx
@@ -36,7 +36,9 @@ export interface EuiDataGridControlHeaderRowProps {
className?: string;
}
-export const EuiDataGridControlHeaderCell: FunctionComponent
= props => {
+export const EuiDataGridControlHeaderCell: FunctionComponent = (
+ props
+) => {
const {
controlColumn,
index,
diff --git a/src/components/datagrid/data_grid_data_row.tsx b/src/components/datagrid/data_grid_data_row.tsx
index 2c102526dc7..3baaa4a1ffe 100644
--- a/src/components/datagrid/data_grid_data_row.tsx
+++ b/src/components/datagrid/data_grid_data_row.tsx
@@ -54,7 +54,7 @@ const DefaultColumnFormatter: EuiDataGridPopoverContent = ({ children }) => {
};
const EuiDataGridDataRow: FunctionComponent = memo(
- props => {
+ (props) => {
const {
leadingControlColumns,
trailingControlColumns,
diff --git a/src/components/datagrid/data_grid_header_cell.tsx b/src/components/datagrid/data_grid_header_cell.tsx
index 5087c666df9..4eb6a2fe561 100644
--- a/src/components/datagrid/data_grid_header_cell.tsx
+++ b/src/components/datagrid/data_grid_header_cell.tsx
@@ -50,7 +50,9 @@ export interface EuiDataGridHeaderCellProps
className?: string;
}
-export const EuiDataGridHeaderCell: FunctionComponent = props => {
+export const EuiDataGridHeaderCell: FunctionComponent = (
+ props
+) => {
const {
column,
index,
@@ -99,7 +101,7 @@ export const EuiDataGridHeaderCell: FunctionComponent= 2 && sortedColumnIds.has(id)) {
sortString = sorting.columns
- .map(col => `Sorted by ${col.id} ${col.direction}`)
+ .map((col) => `Sorted by ${col.id} ${col.direction}`)
.join(' then ');
ariaProps['aria-describedby'] = screenReaderId;
}
diff --git a/src/components/datagrid/data_grid_inmemory_renderer.tsx b/src/components/datagrid/data_grid_inmemory_renderer.tsx
index e28658a7a4c..2a792db82af 100644
--- a/src/components/datagrid/data_grid_inmemory_renderer.tsx
+++ b/src/components/datagrid/data_grid_inmemory_renderer.tsx
@@ -71,7 +71,7 @@ export const EuiDataGridInMemoryRenderer: FunctionComponent {
+ .map((column) => {
const skipThisColumn =
inMemory.skipColumns &&
inMemory.skipColumns.indexOf(column.id) !== -1;
@@ -99,7 +99,7 @@ export const EuiDataGridInMemoryRenderer: FunctionComponent
);
})
- .filter(cell => cell != null)
+ .filter((cell) => cell != null)
);
}
@@ -107,7 +107,7 @@ export const EuiDataGridInMemoryRenderer: FunctionComponent(
- records => {
+ (records) => {
recordLoop: for (let i = 0; i < records.length; i++) {
const record = records[i];
let target: Node | null = record.target;
@@ -156,7 +156,7 @@ export const EuiDataGridInMemoryRenderer: FunctionComponent
- {ref => {cells}
}
+ {(ref) => {cells}
}
,
(documentFragment as unknown) as Element
);
diff --git a/src/components/datagrid/data_grid_schema.tsx b/src/components/datagrid/data_grid_schema.tsx
index af02f089433..beec874e110 100644
--- a/src/components/datagrid/data_grid_schema.tsx
+++ b/src/components/datagrid/data_grid_schema.tsx
@@ -127,10 +127,10 @@ export const schemaDetectors: EuiDataGridSchemaDetector[] = [
return (matchLength / value.length) * confidenceAdjustment || 0;
},
comparator: (a, b, direction) => {
- const aChars = a.split('').filter(char => numericChars.has(char));
+ const aChars = a.split('').filter((char) => numericChars.has(char));
const aValue = parseFloat(aChars.join(''));
- const bChars = b.split('').filter(char => numericChars.has(char));
+ const bChars = b.split('').filter((char) => numericChars.has(char));
const bValue = parseFloat(bChars.join(''));
if (aValue < bValue) return direction === 'asc' ? -1 : 1;
@@ -439,7 +439,7 @@ export function getDetailsForSchema(
detectors: EuiDataGridSchemaDetector[],
providedSchema: string | null
) {
- const results = detectors.filter(matches => {
+ const results = detectors.filter((matches) => {
return matches.type === providedSchema;
});
diff --git a/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx b/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx
index 320557bdd4a..63c5b104307 100644
--- a/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx
+++ b/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx
@@ -88,7 +88,7 @@ export class EuiAbsoluteTab extends Component<
});
};
- handleTextChange: ChangeEventHandler = event => {
+ handleTextChange: ChangeEventHandler = (event) => {
const { onChange } = this.props;
const valueAsMoment = moment(
event.target.value,
diff --git a/src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx b/src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx
index d42a1ce391e..918775d6a23 100644
--- a/src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx
+++ b/src/components/date_picker/super_date_picker/date_popover/date_popover_button.tsx
@@ -52,7 +52,9 @@ export interface EuiDatePopoverButtonProps {
utcOffset?: number;
}
-export const EuiDatePopoverButton: FunctionComponent = props => {
+export const EuiDatePopoverButton: FunctionComponent = (
+ props
+) => {
const {
position,
isDisabled,
diff --git a/src/components/date_picker/super_date_picker/date_popover/date_popover_content.tsx b/src/components/date_picker/super_date_picker/date_popover/date_popover_content.tsx
index d6743e9308a..b73ced799c3 100644
--- a/src/components/date_picker/super_date_picker/date_popover/date_popover_content.tsx
+++ b/src/components/date_picker/super_date_picker/date_popover/date_popover_content.tsx
@@ -55,7 +55,7 @@ export const EuiDatePopoverContent: FunctionComponent {
- const onTabClick: EuiTabbedContentProps['onTabClick'] = selectedTab => {
+ const onTabClick: EuiTabbedContentProps['onTabClick'] = (selectedTab) => {
switch (selectedTab.id) {
case DATE_MODES.ABSOLUTE:
onChange(toAbsoluteString(value, roundUp));
@@ -133,7 +133,7 @@ export const EuiDatePopoverContent: FunctionComponent tab.id === getDateMode(value)
+ (tab) => tab.id === getDateMode(value)
);
return (
diff --git a/src/components/date_picker/super_date_picker/date_popover/relative_tab.tsx b/src/components/date_picker/super_date_picker/date_popover/relative_tab.tsx
index f6521e5548f..502111a2546 100644
--- a/src/components/date_picker/super_date_picker/date_popover/relative_tab.tsx
+++ b/src/components/date_picker/super_date_picker/date_popover/relative_tab.tsx
@@ -72,7 +72,7 @@ export class EuiRelativeTab extends Component<
generateId = htmlIdGenerator();
- onCountChange: ChangeEventHandler = event => {
+ onCountChange: ChangeEventHandler = (event) => {
const sanitizedValue = parseInt(event.target.value, 10);
this.setState(
{
@@ -82,7 +82,7 @@ export class EuiRelativeTab extends Component<
);
};
- onUnitChange: ChangeEventHandler = event => {
+ onUnitChange: ChangeEventHandler = (event) => {
this.setState(
{
unit: event.target.value,
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.tsx b/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.tsx
index a2cff006fc4..e4784b98f44 100644
--- a/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.tsx
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.tsx
@@ -45,7 +45,7 @@ const timeTenseOptions = [
{ value: LAST, text: 'Last' },
{ value: NEXT, text: 'Next' },
];
-const timeUnitsOptions = keysOf(timeUnits).map(key => {
+const timeUnitsOptions = keysOf(timeUnits).map((key) => {
return { value: key, text: `${timeUnits[key]}s` };
});
@@ -89,20 +89,20 @@ export class EuiQuickSelect extends Component<
generateId = htmlIdGenerator();
- onTimeTenseChange: ChangeEventHandler = event => {
+ onTimeTenseChange: ChangeEventHandler = (event) => {
this.setState({
timeTense: event.target.value,
});
};
- onTimeValueChange: ChangeEventHandler = event => {
+ onTimeValueChange: ChangeEventHandler = (event) => {
const sanitizedValue = parseInt(event.target.value, 10);
this.setState({
timeValue: isNaN(sanitizedValue) ? 0 : sanitizedValue,
});
};
- onTimeUnitsChange: ChangeEventHandler = event => {
+ onTimeUnitsChange: ChangeEventHandler = (event) => {
this.setState({
timeUnits: event.target.value as TimeUnitId,
});
@@ -149,9 +149,7 @@ export class EuiQuickSelect extends Component<
const { min, max } = this.getBounds();
const diff = max.diff(min);
this.props.applyTime({
- start: moment(max)
- .add(1, 'ms')
- .toISOString(),
+ start: moment(max).add(1, 'ms').toISOString(),
end: moment(max)
.add(diff + 1, 'ms')
.toISOString(),
@@ -166,9 +164,7 @@ export class EuiQuickSelect extends Component<
start: moment(min)
.subtract(diff + 1, 'ms')
.toISOString(),
- end: moment(min)
- .subtract(1, 'ms')
- .toISOString(),
+ end: moment(min).subtract(1, 'ms').toISOString(),
keepPopoverOpen: true,
});
};
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx b/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx
index 508c0c36f3d..09ba63afd5a 100644
--- a/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx
@@ -72,7 +72,7 @@ export class EuiQuickSelectPopover extends Component<
};
togglePopover = () => {
- this.setState(prevState => ({
+ this.setState((prevState) => ({
isOpen: !prevState.isOpen,
}));
};
diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/refresh_interval.tsx b/src/components/date_picker/super_date_picker/quick_select_popover/refresh_interval.tsx
index 1d181929e6b..49653450fcf 100644
--- a/src/components/date_picker/super_date_picker/quick_select_popover/refresh_interval.tsx
+++ b/src/components/date_picker/super_date_picker/quick_select_popover/refresh_interval.tsx
@@ -40,8 +40,10 @@ import {
import { keysOf } from '../../../common';
const refreshUnitsOptions: RelativeOption[] = keysOf(timeUnits)
- .filter(timeUnit => timeUnit === 'h' || timeUnit === 'm' || timeUnit === 's')
- .map(timeUnit => ({ value: timeUnit, text: timeUnitsPlural[timeUnit] }));
+ .filter(
+ (timeUnit) => timeUnit === 'h' || timeUnit === 'm' || timeUnit === 's'
+ )
+ .map((timeUnit) => ({ value: timeUnit, text: timeUnitsPlural[timeUnit] }));
const MILLISECONDS_IN_SECOND = 1000;
const MILLISECONDS_IN_MINUTE = MILLISECONDS_IN_SECOND * 60;
@@ -100,7 +102,7 @@ export class EuiRefreshInterval extends Component<
generateId = htmlIdGenerator();
- onValueChange: ChangeEventHandler = event => {
+ onValueChange: ChangeEventHandler = (event) => {
const sanitizedValue = parseFloat(event.target.value);
this.setState(
{
@@ -110,7 +112,7 @@ export class EuiRefreshInterval extends Component<
);
};
- onUnitsChange: ChangeEventHandler = event => {
+ onUnitsChange: ChangeEventHandler = (event) => {
this.setState(
{
units: event.target.value as TimeUnitId,
diff --git a/src/components/date_picker/super_date_picker/relative_options.ts b/src/components/date_picker/super_date_picker/relative_options.ts
index cd35770a350..85e0342519c 100644
--- a/src/components/date_picker/super_date_picker/relative_options.ts
+++ b/src/components/date_picker/super_date_picker/relative_options.ts
@@ -39,6 +39,6 @@ export const relativeOptions: RelativeOption[] = [
const timeUnitIds = relativeOptions
.map(({ value }) => value)
- .filter(value => !value.includes('+')) as TimeUnitId[];
+ .filter((value) => !value.includes('+')) as TimeUnitId[];
export const relativeUnitsFromLargestToSmallest = timeUnitIds.reverse();
diff --git a/src/components/date_picker/super_date_picker/relative_utils.test.ts b/src/components/date_picker/super_date_picker/relative_utils.test.ts
index 30021fa8dbc..d5c292065ce 100644
--- a/src/components/date_picker/super_date_picker/relative_utils.test.ts
+++ b/src/components/date_picker/super_date_picker/relative_utils.test.ts
@@ -66,11 +66,7 @@ describe('parseRelativeParts', () => {
describe('absolute', () => {
it('should parse now', () => {
- const out = parseRelativeParts(
- moment()
- .toDate()
- .toISOString()
- );
+ const out = parseRelativeParts(moment().toDate().toISOString());
expect(out).toEqual({
count: 0,
unit: 's',
@@ -80,10 +76,7 @@ describe('parseRelativeParts', () => {
it('should parse 3 months ago', () => {
const out = parseRelativeParts(
- moment()
- .subtract(3, 'M')
- .toDate()
- .toISOString()
+ moment().subtract(3, 'M').toDate().toISOString()
);
expect(out).toEqual({
count: 3,
@@ -94,10 +87,7 @@ describe('parseRelativeParts', () => {
it('should parse 15 minutes ago', () => {
const out = parseRelativeParts(
- moment()
- .subtract(15, 'm')
- .toDate()
- .toISOString()
+ moment().subtract(15, 'm').toDate().toISOString()
);
expect(out).toEqual({
count: 15,
@@ -108,10 +98,7 @@ describe('parseRelativeParts', () => {
it('should parse 2 hours from now', () => {
const out = parseRelativeParts(
- moment()
- .add(2, 'h')
- .toDate()
- .toISOString()
+ moment().add(2, 'h').toDate().toISOString()
);
expect(out).toEqual({
count: 2,
diff --git a/src/components/date_picker/super_date_picker/super_date_picker.tsx b/src/components/date_picker/super_date_picker/super_date_picker.tsx
index a22f47a55a5..7a1f08c4cd3 100644
--- a/src/components/date_picker/super_date_picker/super_date_picker.tsx
+++ b/src/components/date_picker/super_date_picker/super_date_picker.tsx
@@ -297,7 +297,7 @@ export class EuiSuperDatePicker extends Component<
};
onStartDatePopoverToggle = () => {
- this.setState(prevState => {
+ this.setState((prevState) => {
return { isStartDatePopoverOpen: !prevState.isStartDatePopoverOpen };
});
};
@@ -307,7 +307,7 @@ export class EuiSuperDatePicker extends Component<
};
onEndDatePopoverToggle = () => {
- this.setState(prevState => {
+ this.setState((prevState) => {
return { isEndDatePopoverOpen: !prevState.isEndDatePopoverOpen };
});
};
diff --git a/src/components/date_picker/super_date_picker/super_update_button.tsx b/src/components/date_picker/super_date_picker/super_update_button.tsx
index 4564b8346bf..15cdc20f430 100644
--- a/src/components/date_picker/super_date_picker/super_update_button.tsx
+++ b/src/components/date_picker/super_date_picker/super_update_button.tsx
@@ -76,7 +76,7 @@ export class EuiSuperUpdateButton extends Component {
}
}
- setTootipRef: Ref = node => {
+ setTootipRef: Ref = (node) => {
this.tooltip = node;
};
diff --git a/src/components/description_list/description_list.test.tsx b/src/components/description_list/description_list.test.tsx
index f664380f4d3..c3e797520e8 100644
--- a/src/components/description_list/description_list.test.tsx
+++ b/src/components/description_list/description_list.test.tsx
@@ -69,7 +69,7 @@ describe('EuiDescriptionList', () => {
});
describe('type', () => {
- TYPES.forEach(type => {
+ TYPES.forEach((type) => {
test(`${type} is rendered`, () => {
const component = render();
@@ -79,7 +79,7 @@ describe('EuiDescriptionList', () => {
});
describe('align', () => {
- ALIGNMENTS.forEach(alignment => {
+ ALIGNMENTS.forEach((alignment) => {
test(`${alignment} is rendered`, () => {
const component = render();
diff --git a/src/components/description_list/description_list.tsx b/src/components/description_list/description_list.tsx
index 09b6784e4e8..9d3a536781c 100644
--- a/src/components/description_list/description_list.tsx
+++ b/src/components/description_list/description_list.tsx
@@ -84,9 +84,9 @@ const textStylesToClassNameMap = {
export const TEXT_STYLES = keysOf(textStylesToClassNameMap);
-export const EuiDescriptionList: FunctionComponent &
- EuiDescriptionListProps> = ({
+export const EuiDescriptionList: FunctionComponent<
+ CommonProps & HTMLAttributes & EuiDescriptionListProps
+> = ({
align = 'left',
children,
className,
diff --git a/src/components/description_list/description_list_description.tsx b/src/components/description_list/description_list_description.tsx
index a85a1b8a0b5..1638d6662ce 100644
--- a/src/components/description_list/description_list_description.tsx
+++ b/src/components/description_list/description_list_description.tsx
@@ -21,8 +21,9 @@ import React, { HTMLAttributes, FunctionComponent } from 'react';
import classNames from 'classnames';
import { CommonProps } from '../common';
-export const EuiDescriptionListDescription: FunctionComponent> = ({ children, className, ...rest }) => {
+export const EuiDescriptionListDescription: FunctionComponent<
+ CommonProps & HTMLAttributes
+> = ({ children, className, ...rest }) => {
const classes = classNames('euiDescriptionList__description', className);
return (
diff --git a/src/components/description_list/description_list_title.tsx b/src/components/description_list/description_list_title.tsx
index 12b2af3238a..21aa935610b 100644
--- a/src/components/description_list/description_list_title.tsx
+++ b/src/components/description_list/description_list_title.tsx
@@ -21,8 +21,9 @@ import React, { HTMLAttributes, FunctionComponent } from 'react';
import classNames from 'classnames';
import { CommonProps } from '../common';
-export const EuiDescriptionListTitle: FunctionComponent> = ({ children, className, ...rest }) => {
+export const EuiDescriptionListTitle: FunctionComponent<
+ CommonProps & HTMLAttributes
+> = ({ children, className, ...rest }) => {
const classes = classNames('euiDescriptionList__title', className);
return (
diff --git a/src/components/drag_and_drop/drag_drop_context.test.tsx b/src/components/drag_and_drop/drag_drop_context.test.tsx
index 2390f03164b..0bd8bf1e861 100644
--- a/src/components/drag_and_drop/drag_drop_context.test.tsx
+++ b/src/components/drag_and_drop/drag_drop_context.test.tsx
@@ -60,7 +60,7 @@ describe('EuiDragDropContext', () => {
const component = mount(
- {value => (
+ {(value) => (
{value.hasOwnProperty('isDraggingType') ? 'true' : 'false'}
diff --git a/src/components/expression/expression.test.tsx b/src/components/expression/expression.test.tsx
index 1f0317f6741..b6866f648d9 100644
--- a/src/components/expression/expression.test.tsx
+++ b/src/components/expression/expression.test.tsx
@@ -52,7 +52,7 @@ describe('EuiExpression', () => {
describe('props', () => {
describe('color', () => {
- COLORS.forEach(color => {
+ COLORS.forEach((color) => {
test(`${color} is rendered`, () => {
const component = render(
- ) : (
- undefined
- );
+ ) : undefined;
return (
diff --git a/src/components/facet/facet_group.test.tsx b/src/components/facet/facet_group.test.tsx
index c67fe0483b7..e10b8ee2171 100644
--- a/src/components/facet/facet_group.test.tsx
+++ b/src/components/facet/facet_group.test.tsx
@@ -32,7 +32,7 @@ describe('EuiFacetGroup', () => {
describe('props', () => {
describe('layout', () => {
- LAYOUTS.forEach(layout => {
+ LAYOUTS.forEach((layout) => {
test(`${layout} is rendered`, () => {
const component = render();
@@ -42,7 +42,7 @@ describe('EuiFacetGroup', () => {
});
describe('gutterSize', () => {
- GUTTER_SIZES.forEach(size => {
+ GUTTER_SIZES.forEach((size) => {
test(`${size} is rendered`, () => {
const component = render();
diff --git a/src/components/filter_group/filter_select_item.tsx b/src/components/filter_group/filter_select_item.tsx
index 6f6cb7fe264..6b857ebd883 100644
--- a/src/components/filter_group/filter_select_item.tsx
+++ b/src/components/filter_group/filter_select_item.tsx
@@ -101,7 +101,7 @@ export class EuiFilterSelectItem extends Component {
return (