fix(lint): correctly place two misplaced eslint-disable-next-line directives - #5978
Merged
Merged
Conversation
…ectives PR #4849 deleted these two directives because ESLint reported them as unused, but 'unused' here meant misplaced, not stale: each directive's 'next line' landed on a comment/blank line instead of the statement its author meant to cover, so the warning it was meant to suppress was never actually suppressed. - apps/console/.../PublicFormsPage.tsx: the react-hooks/exhaustive-deps directive was an inline block comment inside the useEffect(...) call, so its next line was a blank line. Moved above the statement with the mount-once rationale written out. - packages/react/src/SchemaRenderer.tsx: the no-explicit-any directive's reason wrapped onto a second comment line, so its next line was that continuation comment, not the ForwardedProps declaration. Collapsed to one line. Fixes #4850
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4850
What
PR #4849 (#4833's cleanup) deleted two
eslint-disable-next-linedirectivesbecause ESLint reported them as unused — but "unused" meant misplaced, not
stale: each directive's "next line" landed on a comment/blank line instead
of the statement its author meant to cover, so the warning it targeted had
never actually been suppressed since the directive was written. Deleting them
(the correct call for the other 47 sites in that cleanup) left the two real
warnings unsuppressed, and left the "should this be suppressed at all"
decision unmade — this PR makes that decision and restores correct placement.
apps/console/src/pages/developer/PublicFormsPage.tsx—react-hooks/exhaustive-depsonuseEffect(() => { load(); }, []). Thedirective used to be an inline block comment inside the statement, so its
"next line" was a blank line. Decision: A2 (mount-once is deliberate,
not a bug) — the file's own doc comment already states refresh is via the
explicit Refresh button;
load()is also called explicitly afterpublish/save. Moved the directive above the statement with the reason
spelled out inline.
packages/react/src/SchemaRenderer.tsx—@typescript-eslint/no-explicit-anyontype ForwardedProps = Record<string, any>;. The directive's--reasonwrapped onto a second
//comment line, so its "next line" was thatcontinuation, not the type declaration. Decision: B1 — collapsed to one
line; the existing doc comment directly above already documents the
anyas deliberate (open pass-through forwarding surface).
No logic changes — comment-only diff.
Measured, not eyeballed
pnpm exec eslint <file> --report-unused-disable-directives -f jsonon thetwo files, before vs. after:
PublicFormsPage.tsx:182react-hooks/exhaustive-depsSchemaRenderer.tsx:414@typescript-eslint/no-explicit-anyNo new warning appeared at either site (checked the Zone-3 trap: a directive
that suppresses nothing and one that suppresses the wrong thing look
identical in a diff — confirmed the intended rule, and only that rule, is now
quiet).
Package-level
lint(reverse-verified: reverted the two files toorigin/main@2aff580b5, ran lint, restored):@object-ui/react@object-ui/consoleFull root
pnpm lint(theLintworkflow's gate) after the fix, ate31c8116b: 47/47 tasks successful, 0 errors, 10721 warnings total(matches an independent repo-root
eslint . --report-unused-disable-directives -f jsonscan: 3621 files, 10721 warnings, 2 errors — both from
--report-unused-disable-directivesitself flagging 2 unrelated, pre-existing stale directives, filed separately
as #5973, not touched here). Pre-fix full-repo total is
10723 by construction (10721 + the 2 confirmed per-file suppressions above;
not independently re-run repo-wide to avoid a second ~4-minute full lint pass
whose only new information would be that same arithmetic).
Coupling with #4853 (queued, not dispatched)
#4853 proposes
linterOptions.reportUnusedDisableDirectives: 'error'on thestated precondition that ineffective directives are at zero via #4833/PR
#4849. On current
main, that precondition already holds: the twomisplaced directives this PR fixes were deleted by PR #4849, not left
broken — so
origin/maincurrently has zero eslint-disable directivessuppressing nothing due to placement. This PR doesn't change that zero (it
adds two new, verified-effective directives); it closes the content gap
#4849 explicitly left open (restoring intended suppression, a decision #4849
deliberately deferred). Not enabling the gate here — that stays #4853's call.
Scope
Only these two directives (measured via ESLint, matching the count named in
#4850). One additional pair of now-stale (not misplaced) directives was found
while measuring and filed separately, out of scope for this PR:
#5973.
Changeset
Comment-only, no published behavior change —
.changeset/4850-misplaced-eslint-disable.mdwith empty frontmatter, verified via
node scripts/check-changeset-presence.mjs.Generated by Claude Code