Skip to content

Add @tanstack/eslint-plugin-query and update @typescript-eslint/eslint-plugin#2125

Open
jeesunikim wants to merge 8 commits into
mainfrom
tanstack/eslint-plugin-query
Open

Add @tanstack/eslint-plugin-query and update @typescript-eslint/eslint-plugin#2125
jeesunikim wants to merge 8 commits into
mainfrom
tanstack/eslint-plugin-query

Conversation

@jeesunikim

Copy link
Copy Markdown
Contributor

No description provided.

jeesunikim and others added 3 commits June 24, 2026 11:02
…eslint

Add @tanstack/eslint-plugin-query as a devDependency. It requires
@typescript-eslint/utils ^8.58.1, which would otherwise pull a second
@typescript-eslint tree (8.62) alongside the existing 8.43 used by
eslint-config-next. Align the family on a single 8.62.0 version by bumping
@typescript-eslint/eslint-plugin and adding a matching parser, so the
lockfile resolves to one tree instead of two.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Enable plugin:@tanstack/query/recommended in the ESLint config and fix the
19 exhaustive-deps violations it surfaces. Each affected hook read values in
its queryFn (most commonly headers, plus url/passphrase/asset/count inputs)
that were absent from its queryKey, so distinct inputs could collide on one
cache entry and return stale data. Add the missing values to every queryKey.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fix the "arrowParens:" key (stray colon meant Prettier silently ignored it)
and rename the deprecated jsxBracketSameLine to bracketSameLine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 24, 2026 18:26
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Jun 24, 2026
@jeesunikim jeesunikim linked an issue Jun 24, 2026 that may be closed by this pull request
@socket-security

socket-security Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​typescript-eslint/​parser@​8.62.01001007198100
Added@​tanstack/​eslint-plugin-query@​5.101.11001007597100
Added@​typescript-eslint/​eslint-plugin@​8.62.0881008098100

View full report

@socket-security

socket-security Bot commented Jun 24, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @typescript-eslint/eslint-plugin is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: package.jsonnpm/@typescript-eslint/eslint-plugin@8.62.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@typescript-eslint/eslint-plugin@8.62.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

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 updates the linting toolchain (adds TanStack Query ESLint rules and bumps @typescript-eslint/*) and adjusts React Query queryKeys across the codebase so cached results correctly vary by inputs like headers, URLs, and other request parameters.

Changes:

  • Add @tanstack/eslint-plugin-query and enable plugin:@tanstack/query/recommended in ESLint config.
  • Upgrade @typescript-eslint/eslint-plugin and add @typescript-eslint/parser.
  • Update multiple React Query hooks’ queryKey definitions to include additional dependencies (notably headers), plus fix Prettier config keys.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/query/useWasmGitHubAttestation.ts Includes headers in queryKey to prevent cache collisions across header changes.
src/query/useWasmBinaryFromRpc.ts Includes headers in queryKey for correct caching of RPC wasm binary fetches.
src/query/useRpcHealthCheckUntilReady.ts Includes headers in queryKey so health check results vary by request headers.
src/query/useLatestTxn.ts Adds headers to queryKey so latest-tx queries are keyed by network/header context.
src/query/useLatestLedger.ts Keys latest-ledger query by rpcUrl + headers instead of a global key.
src/query/useHorizonHealthCheckUntilReady.ts Includes headers in queryKey for Horizon health polling correctness.
src/query/useGetRpcTxs.ts Keys RPC tx list by rpcUrl, startLedger, and headers.
src/query/useGetRpcTxDetails.ts Keys RPC tx detail query by rpcUrl, tx, and headers.
src/query/useGetContractDataFromRpcById.ts Expands queryKey inputs to better reflect parameters that affect contract data lookup.
src/query/useFriendBot.ts Expands queryKey to include network context and headers for Friendbot funding requests.
src/query/useFetchRpcTxDetails.ts Includes headers in queryKey for JSON-RPC fetch correctness.
src/query/useEndpoint.ts Expands queryKey to include requestUrl and headers so endpoint responses aren’t cross-cached.
src/query/useCheckTxSignatures.ts Keys signature check by XDR/network inputs plus headers.
src/query/useBuildVerification.ts Includes headers in queryKey for build verification fetching.
src/query/useBuildRpcTransaction.ts Expands queryKey inputs (but currently misses rpcUrl, causing a cache bug).
src/query/useAddTrustline.ts Expands queryKey inputs to include asset/network/header context.
src/query/useAccountSequenceNumber.ts Keys by account + horizonUrl + headers to avoid cross-network cache reuse.
src/query/useAccountInfo.ts Keys by account + horizonUrl + headers.
src/query/external/useSEContractStorage.ts Includes totalEntriesCount in queryKey to keep cache aligned with expected fetch behavior.
package.json Adds TanStack Query ESLint plugin; upgrades @typescript-eslint/* deps.
.eslintrc.json Enables plugin:@tanstack/query/recommended.
.prettierrc.json Fixes Prettier option keys (arrowParens, bracketSameLine).
pnpm-lock.yaml Lockfile updates for the added/updated lint dependencies.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

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

Comment thread src/query/useBuildRpcTransaction.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c773ffcbd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/useBuildRpcTransaction.ts
Comment thread src/query/useLatestTxn.ts
@stellar-jenkins-ci

Copy link
Copy Markdown

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@stellar-jenkins-ci

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e730383490

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .eslintrc.json
@stellar-jenkins-ci

Copy link
Copy Markdown

1 similar comment
@stellar-jenkins-ci

Copy link
Copy Markdown


const txsQuery = useGetRpcTxs({
const {
refetch: refetchTxs,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the object returned from the query hook is not referentially stable. the official doc recommends to destructure the return value of the query hook and pass them into dep array instead.

@stellar-jenkins-ci

Copy link
Copy Markdown

@jeesunikim jeesunikim requested a review from quietbits June 26, 2026 21:16
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stellar-jenkins-ci

Copy link
Copy Markdown

Comment on lines +158 to 162
const errorElement = isError ? (
<Alert variant="error" placement="inline">
{txsQuery.error.message}
{error?.message}
</Alert>
) : null;

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.

To be safe, should we me checking for the error.message instead of isError?

Suggested change
const errorElement = isError ? (
<Alert variant="error" placement="inline">
{txsQuery.error.message}
{error?.message}
</Alert>
) : null;
const errorElement = error?.message ? (
<Alert variant="error" placement="inline">
{error.message}
</Alert>
) : null;

}) => {
const query = useQuery({
queryKey: ["accountInfo", publicKey],
queryKey: ["accountInfo", publicKey, horizonUrl, headers],

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.

Is headers a string or an object? Just want to make sure the query won't be triggered too often.

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

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

Add @tanstack/eslint-plugin-query

3 participants