Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/collection-preferences/visible-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ export default function VisibleContentPreference({
}: VisibleContentPreferenceProps) {
const idPrefix = useUniqueId('visible-content');

const flatOptionsIds = options.reduce<string[]>(
(ids, group) => [...ids, ...group.options.reduce<string[]>((groupIds, option) => [...groupIds, option.id], [])],
[]
);
const flatOptionsIds = options.flatMap(group => group.options.map(option => option.id));

const onToggle = (id: string) => {
if (!isVisible(id, value)) {
Expand Down
5 changes: 1 addition & 4 deletions src/internal/plugins/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 1 addition & 4 deletions src/internal/utils/check-safe-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
13 changes: 2 additions & 11 deletions src/mixed-line-bar-chart/make-scaled-series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,9 @@ function getAllX<T>(series: ReadonlyArray<InternalChartSeries<T>>) {
break;
}
}
const allDataX: T[] = [];
addDataXSet.forEach(x => allDataX.push(x));

return allDataX;
return Array.from(addDataXSet);
}

function flatten<T>(arrays: T[][]): T[] {
const merged: T[] = [];
for (const array of arrays) {
for (const item of array) {
merged.push(item);
}
}
return merged;
return arrays.flat();
}
5 changes: 1 addition & 4 deletions src/table/body-cell/inline-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ export function InlineEditor<ItemType>({
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 {
Copy link
Member

@just-boris just-boris Nov 14, 2025

Choose a reason for hiding this comment

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

Not merge blocking but I would like to hear your thoughts – how do you debug such code?

I have got a few cases where I investigated an issue, I traced it down to such anonymous catch block, but there was no clue how I ended up there. Is there any debug trick to know the currently being thrown error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. In that case I think you'd want to add an error to the catch temporarily for debugging purposes. It does seem like a gap that dev tools don't provide a stack trace in that scenario. 😞

setCurrentEditLoading(false);
focusLockRef.current?.focusFirst();
}
Expand Down
Loading