Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

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

Closed

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 */}
<C schema={{ ... }} />

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.

Activity

  1. claude commented on Aug 25, 2026

    @claude
    Contributor

    Concentrated triage batch: finding → pm:queue + domain:devx, Task, S — two unused react-hooks/static-components directives (sites in the body, measured with --report-unused-disable-directives). Family note: #4853 (queued) is the card for enabling reportUnusedDisableDirectives, and removing these two is its precondition — fold-or-serial is a required answer at claim; both cards are graded, so a family dispatch is available under the five-gate check.


    Generated by Claude Code

  2. added
    domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repo
    and removed on Aug 25, 2026
  3. added theissue type on Aug 25, 2026
  4. yinlianghui-tw commented on Aug 25, 2026

    @yinlianghui-tw
    ContributorAuthor

    Claiming this card.

    • Session: session_019b5UBNMtTzKbVtZZGvFuxe
    • Branch: claude/issue-5973-drop-unused-static-components-directives
    • Base: origin/main @ a76b18cf2

    Declared file surface (2 files):

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

    Fold-or-serial answer for the #4853 family note: SERIAL. This card removes the two unused directives; #4853 (enabling linterOptions.reportUnusedDisableDirectives) is a config change with a repo-wide blast radius and is not folded in here. This PR is #4853's precondition and should land first.

    First step is re-verifying the card's own measurement (--report-unused-disable-directives) on current origin/main before any edit.


    Generated by Claude Code

  5. yinlianghui-tw commented on Aug 25, 2026

    @yinlianghui-tw
    ContributorAuthor
    {
      "issue": 5973,
      "status": "done",
      "branch": "claude/issue-5973-drop-unused-static-components-directives",
      "pr": "https://github.com/objectstack-ai/objectui/pull/6288",
      "premise_still_valid": true,
      "repo_wide_unused_directive_count_measured": { "before": 2, "after": 0 },
      "summary": "Re-ran the card's own measurement on current origin/main (a76b18cf2, not the 2aff580b5 the card measured): `pnpm exec eslint . --report-unused-disable-directives -f json` reports exactly 2 unused directives repo-wide, at exactly the two named locations (record-picker-empty-text-i18n.test.tsx:65 and record-picker-label-placeholder-i18n.test.tsx:71), both react-hooks/static-components. Premise intact and nothing beyond the two named sites was in scope. Deleted both whole comment lines including the `--` justification prose. Serial (not folded) with respect to #4853: after this PR `eslint . --report-unused-disable-directives` exits 0 repo-wide, so #4853 has zero remaining blockers from this class.",
      "tests": "Union re-run on final commit 7c8beecd6 (base a76b18cf2). Exit codes captured by redirect before any pipe. (1) Repo-wide two-direction proof, `pnpm exec eslint . --report-unused-disable-directives -f json`: BEFORE = FILES_LINTED 3723, TOTAL_ERRORS 2 (both being the unused directives), TOTAL_WARNINGS 10882, UNUSED_DIRECTIVE_COUNT 2; AFTER = FILES_LINTED 3723, TOTAL_ERRORS 0, TOTAL_WARNINGS 10882, UNUSED_DIRECTIVE_COUNT 0. The identical 10882 warning total is the second-half proof: no new warning appeared at the formerly-suppressed lines or anywhere else, so the directives were not load-bearing. Per-file, each file keeps exactly its one pre-existing @typescript-eslint/no-explicit-any warning (line 58 / line 64) and gains nothing. Non-vacuity check: `pnpm exec eslint --print-config <file>` prints `react-hooks/static-components = [2]` for the edited file, so the rule is live at severity 2 there and still does not fire. Deletion confirmed on disk before any reading: directive anchor grep -c 1 -> 0 per file, line counts 121 -> 120 and 179 -> 178, `git diff --stat` = 2 files changed, 2 deletions(-). (2) Two affected test files by name from the repo ROOT (a repo guard rejects `cd packages/components && vitest` as silently-wrong-testset, objectui#3378): `Test Files  2 passed (2)` / `Tests  18 passed (18)`. (3) @object-ui/components test project unnarrowed: `Test Files  187 passed (187)` / `Tests  1708 passed (1708)`. (4) `pnpm lint:root` UNNARROWED: `X 28 problems (0 errors, 28 warnings)`, exit 0 -- exactly the stated baseline. Caveat: lint:root ignores `packages/*/**` and therefore does NOT cover the two edited files; their file-level coverage comes from the repo-wide `eslint .` runs in (1). (5) `pnpm --filter @object-ui/components type-check`: exit 0, script name echoed as `@object-ui/components@17.6.0 type-check` (no zero-match). First attempt hit the stale-dist trap with TS2307 in untouched files; fixed by `pnpm --workspace-concurrency=2 --filter '@object-ui/components^...' build` first. (6) `node scripts/check-control-bytes.mjs`: `check-control-bytes: OK (scanned 5179 tracked text file(s); skipped 85 binary).` plus a self-scan of the changed files with grep -naP for control bytes, no matches. (7) Changeset gate BOTH ways: without a changeset exit 1, verdict `2 source file(s) of 1 released package(s) changed, and this change adds no changeset`; with the empty-frontmatter changeset exit 0, verdict `... declares 1 changeset(s): .changeset/spotty-pianos-shave.md. Every one of them has an EMPTY frontmatter -- declared as releasing nothing, which is the explicit exemption and a complete answer to this gate.` Also `check-changeset-no-major.mjs` = `No changeset declares a major bump.` and `check-changeset-fixed.mjs` = `All workspace packages are in the changeset fixed group.` No skip-changeset label was created or applied (phantom in this repo). All heavy runs went through the shared verify lock; longest wait 2m54s, longest hold 7m12s (the components test project).",
      "open_questions": [],
      "out_of_scope_findings": []
    }

    Generated by Claude Code

  6. yinlianghui-tw commented on Aug 25, 2026

    @yinlianghui-tw
    ContributorAuthor

    os-dev-report

    (Supersedes the previous comment: GitHub's body sanitizer ate the <!-- os-dev-report --> HTML-comment marker on save, making that copy invisible to the PM scan. Literal-text marker used instead. Content is otherwise identical.)

    {
      "issue": 5973,
      "status": "done",
      "branch": "claude/issue-5973-drop-unused-static-components-directives",
      "pr": "https://github.com/objectstack-ai/objectui/pull/6288",
      "premise_still_valid": true,
      "repo_wide_unused_directive_count_measured": { "before": 2, "after": 0 },
      "summary": "Re-ran the card's own measurement on current origin/main (base a76b18cf2, not the 2aff580b5 the card measured): 'pnpm exec eslint . --report-unused-disable-directives -f json' reports exactly 2 unused directives repo-wide, at exactly the two named locations (record-picker-empty-text-i18n.test.tsx:65 and record-picker-label-placeholder-i18n.test.tsx:71), both react-hooks/static-components. Premise intact, and no other unused directive exists anywhere in the repo, so nothing beyond the two named sites was in scope. Deleted both whole comment lines including the '--' justification prose. Serial (not folded) with respect to #4853: after this PR 'eslint . --report-unused-disable-directives' exits 0 repo-wide, so #4853 has zero remaining blockers from this class.",
      "tests": "Union re-run on final commit 7c8beecd6 (base a76b18cf2). Exit codes captured by redirect before any pipe; every verdict below is the gate's own printed line. (1) Repo-wide two-direction proof, 'pnpm exec eslint . --report-unused-disable-directives -f json': BEFORE = FILES_LINTED 3723, TOTAL_ERRORS 2 (both being the unused directives), TOTAL_WARNINGS 10882, UNUSED_DIRECTIVE_COUNT 2; AFTER = FILES_LINTED 3723, TOTAL_ERRORS 0, TOTAL_WARNINGS 10882, UNUSED_DIRECTIVE_COUNT 0. The identical 10882 warning total is the second-half proof: no new warning appeared at the formerly-suppressed lines or anywhere else, so the directives were not load-bearing. Per-file, each file keeps exactly its one pre-existing @typescript-eslint/no-explicit-any warning (line 58 / line 64) and gains nothing. Non-vacuity check: 'pnpm exec eslint --print-config' on the edited file prints 'react-hooks/static-components = [2]', so the rule is live at severity 2 there and still does not fire. Deletion confirmed on disk before any measurement was read: directive anchor 'grep -c' 1 to 0 per file, line counts 121 to 120 and 179 to 178, 'git diff --stat' = 2 files changed, 2 deletions(-). (2) Two affected test files by name, run from the repo ROOT (a repo guard rejects 'cd packages/components && vitest' as a silently-wrong test set, objectui#3378): 'Test Files  2 passed (2)' / 'Tests  18 passed (18)'. (3) @object-ui/components test project unnarrowed: 'Test Files  187 passed (187)' / 'Tests  1708 passed (1708)'. (4) 'pnpm lint:root' UNNARROWED: 'X 28 problems (0 errors, 28 warnings)', exit 0 -- exactly the stated baseline. Caveat: lint:root ignores 'packages/*/**' and therefore does NOT cover the two edited files; their file-level coverage comes from the repo-wide 'eslint .' runs in (1). (5) 'pnpm --filter @object-ui/components type-check': exit 0, script name echoed as '@object-ui/components@17.6.0 type-check' (so not a zero-match silent pass). First attempt hit the stale-dist trap with TS2307 in untouched files; fixed by running 'pnpm --workspace-concurrency=2 --filter @object-ui/components^... build' first. (6) 'node scripts/check-control-bytes.mjs': 'check-control-bytes: OK (scanned 5179 tracked text file(s); skipped 85 binary).' plus a self-scan of the changed files with 'grep -naP' for control bytes, no matches. (7) Changeset gate BOTH ways: without a changeset exit 1, verdict '2 source file(s) of 1 released package(s) changed, and this change adds no changeset'; with the empty-frontmatter changeset exit 0, verdict '... declares 1 changeset(s): .changeset/spotty-pianos-shave.md. Every one of them has an EMPTY frontmatter -- declared as releasing nothing, which is the explicit exemption and a complete answer to this gate.' Also 'check-changeset-no-major.mjs' = 'No changeset declares a major bump.' and 'check-changeset-fixed.mjs' = 'All workspace packages are in the changeset fixed group.' No skip-changeset label was created or applied (phantom in this repo). All heavy runs went through the shared verify lock; longest wait 2m54s, longest hold 7m12s (the components test project). CI not awaited, per dispatch contract.",
      "open_questions": [],
      "out_of_scope_findings": []
    }

    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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