diff --git a/src/collection-preferences/visible-content.tsx b/src/collection-preferences/visible-content.tsx index 4e2ea2b95c..b2b7871b2c 100644 --- a/src/collection-preferences/visible-content.tsx +++ b/src/collection-preferences/visible-content.tsx @@ -33,10 +33,7 @@ export default function VisibleContentPreference({ }: VisibleContentPreferenceProps) { const idPrefix = useUniqueId('visible-content'); - const flatOptionsIds = options.reduce( - (ids, group) => [...ids, ...group.options.reduce((groupIds, option) => [...groupIds, option.id], [])], - [] - ); + const flatOptionsIds = options.flatMap(group => group.options.map(option => option.id)); const onToggle = (id: string) => { if (!isVisible(id, value)) { diff --git a/src/internal/plugins/api.ts b/src/internal/plugins/api.ts index 4cc25cdb6b..3aa4543296 100644 --- a/src/internal/plugins/api.ts +++ b/src/internal/plugins/api.ts @@ -51,10 +51,7 @@ function findUpApi(currentWindow: WindowWithApi): AwsuiApi | undefined { } return findUpApi(currentWindow.parent as WindowWithApi); - - // Consumers in the past have not always been able to support not specifiying the value so we keep and ignore - // eslint-disable-next-line @typescript-eslint/no-unused-vars - } catch (ex) { + } catch { // Most likely a cross-origin access error return undefined; } diff --git a/src/internal/utils/check-safe-url.ts b/src/internal/utils/check-safe-url.ts index 1d53baeda1..bdc074f919 100644 --- a/src/internal/utils/check-safe-url.ts +++ b/src/internal/utils/check-safe-url.ts @@ -15,10 +15,7 @@ export function checkSafeUrl(component: string, url: string | undefined | null): let parsedUrl: URL; try { parsedUrl = new URL(url); - - // Consumers in the past have not always been able to support not specifiying the value so we keep and ignore - // eslint-disable-next-line @typescript-eslint/no-unused-vars - } catch (e) { + } catch { // If the URL cannot be parsed by the browser, it likely does not pose a security risk. return; } diff --git a/src/mixed-line-bar-chart/make-scaled-series.ts b/src/mixed-line-bar-chart/make-scaled-series.ts index b04c961161..6d2df032ee 100644 --- a/src/mixed-line-bar-chart/make-scaled-series.ts +++ b/src/mixed-line-bar-chart/make-scaled-series.ts @@ -118,18 +118,9 @@ function getAllX(series: ReadonlyArray>) { break; } } - const allDataX: T[] = []; - addDataXSet.forEach(x => allDataX.push(x)); - - return allDataX; + return Array.from(addDataXSet); } function flatten(arrays: T[][]): T[] { - const merged: T[] = []; - for (const array of arrays) { - for (const item of array) { - merged.push(item); - } - } - return merged; + return arrays.flat(); } diff --git a/src/table/body-cell/inline-editor.tsx b/src/table/body-cell/inline-editor.tsx index 573468dee3..a728dcc28d 100644 --- a/src/table/body-cell/inline-editor.tsx +++ b/src/table/body-cell/inline-editor.tsx @@ -63,10 +63,7 @@ export function InlineEditor({ await submitEdit(item, column, currentEditValue); setCurrentEditLoading(false); finishEdit(); - - // Consumers in the past have not always been able to support not specifiying the value so we keep and ignore - // eslint-disable-next-line @typescript-eslint/no-unused-vars - } catch (e) { + } catch { setCurrentEditLoading(false); focusLockRef.current?.focusFirst(); }