Commit 7ef5366
* chore: enable react-hooks/immutability and enforce _ prefix for unused destructure siblings (#941)
- Re-enable the react-hooks/immutability rule and fix the one
violation in VariableSizeListItem: replace delete style.height
(prop mutation) with a non-mutating destructure.
- Tighten @typescript-eslint/no-unused-vars: drop the implicit
ignoreRestSiblings allowance and instead require unused
destructure siblings to be _-prefixed (argsIgnorePattern +
varsIgnorePattern = ^_). This forces intentional-omit cases to
be visibly marked.
- Apply the convention to the existing intentional-omit sites and
drop the now-redundant eslint-disable directives.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: enable react-hooks/refs (#941)
- useAsync: per-site suppress on the useReducer initialStateRef
access. useReducer reads its second arg only on first render,
at which point initialStateRef.current is the same `state`
value the ref was just initialized with — safe.
- FilterTag: per-site suppress on the overflow-detection block.
The current ref-during-render measurement is genuinely broken
(not reactive to resize / label change). Proper fix tracked
in #949.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: document react-hooks/incompatible-library as not applicable (#941)
The rule is a React-Compiler-aware check (e.g. TanStack Table /
Virtual return values carry hidden mutable state). findable-ui
does not use the React Compiler, so the rule is not earning its
keep. Keep it off with an inline comment explaining the decision
and pointing at the revisit trigger (Compiler adoption).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: address simple set-state-in-effect sites (#941)
Five sites improved + one unused hook deleted. Rule itself stays
off in this commit; it'll be flipped on once the remaining sites
(MarkdownRenderer, UseTabs, useSessionTimeout, loginGuard, four
terra/* hooks) are addressed.
- useLocalStorage: migrate to useSyncExternalStore. Returns
undefined from the server snapshot to preserve the "not loaded
yet" sentinel that CookieBanner depends on; null or a string
on the client. Reacts to cross-tab storage events.
- useFeatureFlag: migrate to useSyncExternalStore. Returns false
on the server, the FLAG.TRUE comparison on the client.
- useResetableState: delete. Workspace audit found no consumers.
The "sync prop to state via effect" shape it implemented is
also an anti-pattern per current React docs.
- EllipsisContent: drop the redundant mount effect that
transitioned state from undefined to NONE (behaviorally
identical to starting at NONE). Tighten helper signatures now
that ellipsisMode is always defined.
- CollapsableSection: replace the breakpoint useEffect with the
React-docs adjust-during-render pattern. Replace the
setTimeout-based transition-duration "settle" trick with
Collapse's onEntered and onExited callbacks. Drop the outer
JSX ternary; Collapse stays mounted and `in` is driven by
`disabled || expanded` so desktop is force-open.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: enable react-hooks/set-state-in-effect (#941)
Final batch of the set-state-in-effect cluster. All flagged sites
addressed; rule now turned on at "error" level. Mix of structural
fixes (preferred) and per-site suppressions (where the pattern is
correct but the rule is overzealous).
Structural fixes:
- useHash: migrate to useSyncExternalStore subscribing to
`hashchange`. Now SSR-safe (no hydration mismatch on URLs with
fragments) and reactive to hash changes — both pre-existing
gaps the old non-subscribing read had.
- useTabs: drop the useState+useEffect indirection; derive
`value` directly from `useHash()` + outline. Initial value is
correct on first render — no DEFAULT_TAB_VALUE flash.
- MarkdownRenderer: move the `setError(null)` reset into the
fetch success handler so there is no synchronous setState in
the effect body. Trade-off: stale error stays visible one
parse cycle longer; net win in error→error transitions
(no zero-error flash between).
- useSessionTimeout: drop useLocation, use useSearchParams from
next/navigation. Sticky semantics preserved via
adjust-during-render with a prev-value tracker — the banner
only goes false via clearSessionTimeout, not via unrelated
navigation that happens to drop the URL param (the state-sync
manager does this).
- loginGuard provider: split the auth-success effect into
adjust-during-render (setOpen(false)) + a separate effect that
fires the stored callback. Clarifies pure-state vs side-effect.
- useFetchProfiles: drop useState+useEffect; derive `status`
directly during render via getProfileStatus(...).
Per-site suppressions (with justification comments):
- useFetchTerraNIHProfile, useFetchTerraProfile,
useFetchTerraTermsOfService: async fetch pattern with a
synchronous "set to PENDING" before the network call. Refactor
would require a data-fetching library or external store.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: enable react-hooks/static-components (#941)
Final rule from the v7 cluster. Codebase has zero violations,
so this just turns the rule on at error level to prevent future
regressions (the rule catches components defined inside other
components, which create new component identity on every render).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs: address copilot review on #941 markdown renderer
- Move setError(null) out of the isValidElement branch so any
successful parse clears a stale error, even when the result
isn't a renderable element.
- Set element to null in the non-element case so we don't leave
a stale previous element rendering.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: address copilot review on #941 useSessionTimeout init
Initialize both isSessionTimeout and prevSessionTimeout from the
current sessionTimeout value, so the adjust-during-render block
doesn't fire on first mount when the URL param is absent
(searchParams.get returns null in that case, which differed from
the prior `undefined` init and forced a discarded render).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Fran McDade <18710366+frano-m@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 83903dd commit 7ef5366
23 files changed
Lines changed: 190 additions & 149 deletions
File tree
- src
- components
- Filter/components
- FilterTag
- Filter/components/DrawerTransition
- SearchAllFilters/components/OutlinedInput
- VariableSizeListItem
- Layout/components/Outline/hooks
- UseHash
- UseTabs
- MarkdownRenderer
- TableCreator/common
- common
- EllipsisContent
- Section/components/CollapsableSection
- StatusBadge
- hooks
- authentication/session
- useFeatureFlag
- useLocalStorage
- providers
- loginGuard
- terra/hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
58 | 64 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
Lines changed: 26 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
17 | 33 | | |
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | | - | |
14 | 12 | | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 19 | | |
25 | 20 | | |
26 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | | - | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
Lines changed: 7 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | 43 | | |
50 | 44 | | |
51 | 45 | | |
| |||
119 | 113 | | |
120 | 114 | | |
121 | 115 | | |
122 | | - | |
| 116 | + | |
123 | 117 | | |
124 | 118 | | |
125 | 119 | | |
| |||
149 | 143 | | |
150 | 144 | | |
151 | 145 | | |
152 | | - | |
| 146 | + | |
153 | 147 | | |
154 | 148 | | |
155 | 149 | | |
| |||
189 | 183 | | |
190 | 184 | | |
191 | 185 | | |
192 | | - | |
193 | | - | |
| 186 | + | |
| 187 | + | |
194 | 188 | | |
195 | 189 | | |
196 | 190 | | |
| |||
0 commit comments