Skip to content

[Deps] Add tanstack eslint plugin - #1823

Open
Anders2303 wants to merge 3 commits into
equinor:mainfrom
Anders2303:deps/add-tanstack-eslint-plugin
Open

[Deps] Add tanstack eslint plugin#1823
Anders2303 wants to merge 3 commits into
equinor:mainfrom
Anders2303:deps/add-tanstack-eslint-plugin

Conversation

@Anders2303

Copy link
Copy Markdown
Collaborator

Resolves #460

Adds Tanstack's eslint plugin for queries

@Anders2303
Anders2303 requested a review from rubenthoms July 9, 2026 13:14
@Anders2303
Anders2303 enabled auto-merge (squash) July 9, 2026 13:15
@rubenthoms
rubenthoms requested a review from Copilot July 9, 2026 15:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds TanStack’s React Query ESLint plugin to the frontend and updates a few query-related call sites to comply with the plugin’s recommended rules (primarily around stable dependencies and exhaustive query keys).

Changes:

  • Add @tanstack/eslint-plugin-query to dev dependencies and enable its flat/recommended config in eslint.config.js.
  • Refactor a couple of hooks/effects to depend on stable, destructured query methods/fields rather than entire query result objects.
  • Make the useInfiniteSessionMetadataQuery query key and query params more explicit (including sort_lowercase and zCacheBust) and add a targeted rule disable where the rule can’t be reasonably enforced.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/src/framework/utils/lro/longRunningApiCalls.ts Adds a targeted TanStack query ESLint disable for a wrapper that can’t reliably satisfy exhaustive key requirements.
frontend/src/framework/internal/hooks/useRefreshQuery.ts Uses a stable destructured refetch reference to avoid depending on the whole query result object.
frontend/src/framework/internal/components/PersistenceManagementDialog/snapshotManagementContent.tsx Removes unstable query object deps from an effect by destructuring fetchNextPage and listing specific fields.
frontend/src/framework/internal/components/PersistenceManagementDialog/_utils.ts Makes query key/query params explicit and includes additional params required for exhaustive query key compliance.
frontend/package.json Adds @tanstack/eslint-plugin-query dev dependency.
frontend/eslint.config.js Enables TanStack query ESLint plugin recommended flat config.
Files not reviewed (1)
  • frontend/package-lock.json: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/eslint.config.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add react-query eslint plugin

3 participants