Skip to content

MAINT: Bump eslint-plugin-react-hooks from 5.2.0 to 7.1.1 in /frontend#1984

Merged
romanlutz merged 4 commits into
mainfrom
dependabot/npm_and_yarn/frontend/eslint-plugin-react-hooks-7.1.1
Jun 11, 2026
Merged

MAINT: Bump eslint-plugin-react-hooks from 5.2.0 to 7.1.1 in /frontend#1984
romanlutz merged 4 commits into
mainfrom
dependabot/npm_and_yarn/frontend/eslint-plugin-react-hooks-7.1.1

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jun 10, 2026

Copy link
Copy Markdown
Contributor

Bumps eslint-plugin-react-hooks from 5.2.0 to 7.1.1.

Release notes

Sourced from eslint-plugin-react-hooks's releases.

eslint-plugin-react-hooks@7.1.1 (April 17, 2026)

Note: 7.1.0 accidentally removed the component-hook-factories rule, causing errors for users who referenced it in their ESLint config. This is now fixed.

  • Add deprecated no-op component-hook-factories rule for backwards compatibility. (@​mofeiZ in #36307)

eslint-plugin-react-hooks@7.1.0 (April 16, 2026)

This release adds ESLint v10 support, improves performance by skipping compilation for non-React files, and includes compiler lint improvements including better set-state-in-effect detection, improved ref validation, and more helpful error reporting.

Changelog

Sourced from eslint-plugin-react-hooks's changelog.

7.1.1

Note: 7.1.0 accidentally removed the component-hook-factories rule, causing errors for users who referenced it in their ESLint config. This is now fixed.

  • Add deprecated no-op component-hook-factories rule for backwards compatibility. (@​mofeiZ in #36307)

7.1.0

This release adds ESLint v10 support, improves performance by skipping compilation for non-React files, and includes compiler lint improvements including better set-state-in-effect detection, improved ref validation, and more helpful error reporting.

7.0.1

  • Disallowed passing inline useEffectEvent values as JSX props to guard against accidental propagation. (#34820 by @​jf-eirinha)
  • Switch to export = so eslint-plugin-react-hooks emits correct types for consumers in Node16 ESM projects. (#34949 by @​karlhorky)
  • Tightened the typing of configs.flat so the configs export is always defined. (#34950 by @​poteto)
  • Fix named import runtime errors. (#34951, #34953 by @​karlhorky)

7.0.0

This release slims down presets to just 2 configurations (recommended and recommended-latest), and all compiler rules are enabled by default.

  • Breaking: Removed recommended-latest-legacy and flat/recommended configs. The plugin now provides recommended (legacy and flat configs with all recommended rules), and recommended-latest (legacy and flat configs with all recommended rules plus new bleeding edge experimental compiler rules). (@​poteto in #34757)

6.1.1

Note: 6.1.0 accidentally allowed use of recommended without flat config, causing errors when used with ESLint v9's defineConfig() helper. This has been fixed in 6.1.1.

6.1.0

Note: Version 6.0.0 was mistakenly released and immediately deprecated and untagged on npm. This is the first official 6.x major release and includes breaking changes.

... (truncated)

Commits

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Jun 10, 2026
@romanlutz romanlutz self-assigned this Jun 10, 2026
Bumps [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks) from 5.2.0 to 7.1.1.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/react/react/blob/main/packages/eslint-plugin-react-hooks/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/eslint-plugin-react-hooks@7.1.1/packages/eslint-plugin-react-hooks)

---
updated-dependencies:
- dependency-name: eslint-plugin-react-hooks
  dependency-version: 7.1.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/frontend/eslint-plugin-react-hooks-7.1.1 branch from ed54717 to 0d058cd Compare June 10, 2026 14:25
Copilot AI added 3 commits June 10, 2026 07:32
The bump to v7 enables the React Compiler rules including
react-hooks/set-state-in-effect and react-hooks/refs by default,
which flag 14 existing violations across 8 files.

Refactors:
- App.tsx ConnectionBanner: derive showReconnected from a
  dismissedCount counter so the auto-dismiss timer is the only
  setter (in a setTimeout callback).
- ChatWindow.tsx: replace stale-pieceConversions cleanup effect
  with a useMemo; switch panel auto-open and message clear to the
  ''adjust state during render'' pattern; replace
  sendingConvIdsRef.current.has(...) in render with the
  sendingConversations state.
- ConversationPanel.tsx, TargetConfig.tsx, Home.tsx,
  AttackHistory.tsx, ConverterPanel.tsx: move all setState calls
  into Promise .then/.catch/.finally callbacks; init isLoading
  based on initial fetch needs; trigger refetch via a state token
  bumped from event handlers.
- CreateTargetDialog.tsx, ConverterPanel.tsx, ConversationPanel.tsx:
  use ''adjust state during render'' with a sentinel for prop-driven
  state syncs (existingTargets, attackResultId reset, clear preview).
- AttackHistory.tsx: extract buildListParams helper; combine
  page reset with the fetch effect.

Verified:
- npm run lint -- 0 errors / 0 warnings
- npm run type-check -- clean
- npm test -- 28 suites, 649 tests passing (act() warning count
  unchanged from baseline)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Browser-based validation revealed a bug in the previous refactor: the
clear-preview-when-empty logic used a sentinel keyed off (tab, input),
which only fired the first time the input transitioned to empty per
key. The original useEffect cleared on every empty render.

Replace the sentinel with a prev-value comparison so the reset fires
exactly once per input transition - even when the user types, clears,
types, and clears again.

Validated end-to-end with Playwright:
- Type 'hello' -> base64 preview appears
- Clear -> preview clears to placeholder
- Type 'world' -> new base64 preview appears
- Clear -> preview clears to placeholder again (was broken before)

All 28 jest suites / 649 tests still pass; lint and type-check clean.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@romanlutz
romanlutz added this pull request to the merge queue Jun 11, 2026
Merged via the queue into main with commit 7e2be11 Jun 11, 2026
49 checks passed
@romanlutz
romanlutz deleted the dependabot/npm_and_yarn/frontend/eslint-plugin-react-hooks-7.1.1 branch June 11, 2026 04:18
varunj-msft added a commit to varunj-msft/PyRIT that referenced this pull request Jun 12, 2026
CI lints with the merged state of (PR branch + origin/main), and main
upgraded eslint-plugin-react-hooks to v7 (PR microsoft#1984) which adds the
`set-state-in-effect` rule. My branch's package.json still pins v5
locally so this wasn't caught pre-push, but the merge resolution at
CI time gives v7 and the rule fires on the synchronous
setLoading(true)/setError(null)/setResult(null) calls at the top of
my useEffect body.

Refactor: tag the cached result+error with the target name they were
requested for (`requestedFor` state), then derive `loading`,
`displayResult`, and `displayError` from current target vs that tag.
Switching targets makes the prior tag no longer match, so the display
reverts to the spinner without any synchronous state mutation inside
the effect. Same-target reopen still needs the explicit reset in
handleClose to re-fire the effect (the [open, name] deps tuple is
identical across close→reopen).

All 39 dialog+table tests still pass; full frontend suite 669/669
still green. Verified the fix against v7 locally by temporarily
upgrading the lockfile and running eslint on just my changed files —
clean. Reverted the lockfile bump because the upgrade belongs to
PR microsoft#1984, not this PR; the merge will combine main's v7 plugin with
my source-level fix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants