Skip to content

Commit 894b397

Browse files
committed
fix(web): properly remove unused openalex variable
- Use delete operator instead of destructuring with unused variable - Resolves sonarjs/no-unused-vars violation without underscore prefix
1 parent f475ae0 commit 894b397

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/web/src/components/EntityDataDisplay.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ const groupFields = (data: Record<string, unknown>): SectionData[] => {
234234
const ids = processedData.ids as Record<string, unknown>;
235235
const openalexId = typeof ids.openalex === "string" ? ids.openalex.toLowerCase() : null;
236236
if (openalexId && mainId.includes(openalexId.split("/").pop() ?? "")) {
237-
// Remove openalex from ids since it's redundant with main id
238-
const { openalex: _, ...remainingIds } = ids;
237+
// Create a copy and remove openalex from ids since it's redundant with main id
238+
const remainingIds = { ...ids };
239+
delete remainingIds.openalex;
239240
if (Object.keys(remainingIds).length > 0) {
240241
processedData.ids = remainingIds;
241242
} else {

0 commit comments

Comments
 (0)