Skip to content

fix(ui): replace array index React keys in select and table of contents - #9336

Open
RedaMG1 wants to merge 3 commits into
nodejs:mainfrom
RedaMG1:fix/ui-stable-react-keys-9333
Open

RedaMG1 wants to merge 3 commits into
nodejs:mainfrom
RedaMG1:fix/ui-stable-react-keys-9333

Conversation

@RedaMG1

@RedaMG1 RedaMG1 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #9333.

Summary

Remove three @eslint-react/no-array-index-key warnings in the Node.js website's React components.

  • Use stable group values as fallback keys in Select and StatelessSelect.
  • Use heading depth and text as a fallback key in TableOfContents.

Verification

  • Verified that only the three affected components were modified.
  • Confirmed the index-based keys were replaced.
  • Full ESLint and UI tests have not been run locally.

@RedaMG1
RedaMG1 requested a review from a team as a code owner November 16, 2026 13:21
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nodejs-org Ready Ready Preview Nov 16, 2026 1:22pm UTC

Request Review

@ovflowd ovflowd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Appreciate the contribution, @RedaMG1 but this change isn't needed. We're not facing any actual current issue with the current approach, despite indeed, these being non-unique keys.

@MattIPv4

Copy link
Copy Markdown
Member

Appreciate the contribution, @RedaMG1 but this change isn't needed. We're not facing any actual current issue with the current approach, despite indeed, these being non-unique keys.

I disagree with asserting that this change isn't needed... yes the current logic works fine, but it is creating lint noise for everyone. We could add lint disable comments for the lines, or we could just accept this change?

@MikeMcC399

Copy link
Copy Markdown
Member

From issue #9333


Desired behavior

The contributing instructions require a clean result from running linting, so this should be the case for the default branch. Executing node --run format should not produce any warnings.

The PULL_REQUEST_TEMPLATE.md includes the Check List line:

  • I have run pnpm format to ensure the code follows the style guide.

It's implied that PR submitters should not only run linting, but should also ensure that linting produces no errors or warnings.

@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.20%. Comparing base (48bd7b5) to head (ce59f87).
⚠️ Report is 10 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/ui-components/src/Common/Select/index.tsx 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9336      +/-   ##
==========================================
+ Coverage   87.06%   87.20%   +0.14%     
==========================================
  Files          90       92       +2     
  Lines        6426     6661     +235     
  Branches      389      404      +15     
==========================================
+ Hits         5595     5809     +214     
- Misses        827      848      +21     
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Size Comparison

Summary

Metric Value
Old Total First Load JS 7.19 MB
New Total First Load JS 7.23 MB
Delta 37.37 KB (+0.51%)

Changes

🔄 Modified Routes (5)
Route Old First Load JS New First Load JS Delta
/[locale] 1.69 MB 1.70 MB 📈 9.08 KB (+0.53%)
/[locale]/[...path] 1.69 MB 1.70 MB 📈 9.08 KB (+0.53%)
/[locale]/blog/[...path] 1.69 MB 1.70 MB 📈 9.08 KB (+0.53%)
/[locale]/download/archive/[version] 1.69 MB 1.70 MB 📈 9.08 KB (+0.53%)
/_not-found 447.16 KB 448.20 KB 📈 1.04 KB (+0.23%)

@MikeMcC399

Copy link
Copy Markdown
Member

Full ESLint and UI tests have not been run locally.

I am surprised to read that in the PR text considering that the PR is supposed to fix linting.

@MikeMcC399

Copy link
Copy Markdown
Member

@RedaMG1

Please run pnpm format in your PR branch to fix the Prettier linting.
Also update the branch to pick up the Playwright fixes.

Comment on lines +89 to +90
label?.toString() ??
JSON.stringify(items.map(({ value }) => value))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This fails Prettier linting

This branch was successfully deployed

2 active deployments
Storybook — ce59f87f Deployed Nov 23, 2026 by RedaMG1 via Chromatic #2481
Preview — ce59f87f Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linter warning @eslint-react/no-array-index-key after Dependabot PR #9278

4 participants