Skip to content

finding: 2 eslint-disable-next-line react-hooks/static-components directives now report as unused (record-picker i18n tests) #5973

Description

@yinlianghui-tw

Observation-class, filed while measuring the eslint-disable-next-line landscape for #4850 (only warnings, no gate at risk — linterOptions.reportUnusedDisableDirectives is not enabled, see #4853).

What

pnpm exec eslint . --report-unused-disable-directives -f json on origin/main @ 2aff580b5 reports 2 unused directives, both react-hooks/static-components, both correctly placed (immediately above the line they target — this is NOT the misplaced-directive defect class #4850/#4833/#4849 covered):

  • packages/components/src/__tests__/record-picker-empty-text-i18n.test.tsx:65
  • packages/components/src/renderers/basic/__tests__/record-picker-label-placeholder-i18n.test.tsx:71

Both read:

{/* eslint-disable-next-line react-hooks/static-components -- ComponentRegistry.get returns the registered component (stable), not one created during render */}<Cschema={{ ... }}/>

Both test files were added for #5590 / #5637 (both closed). The rule no longer fires on this exact JSX pattern — same class as the 47 legitimately-stale directives #4833/PR #4849 already cleaned up (warning-suppressed-content-since-removed), not the misplaced-directive class #4850 is fixing (never-suppressed-since-day-one).

Why not fixed here

#4850's scope is the two directives it measured and fixed (a different defect class — placement, not staleness); this is a finding, not that PR's work.

Suggested resolution

Delete both directive comments (same treatment as the other 47 sites #4849 handled), or confirm via eslint --report-unused-disable-directives after deletion that no new warning appears.

Metadata

Metadata

Labels

domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repopm:queue

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions