Files
supabase/apps/studio/data/database
Charis 5d8499b6f1 chore(eslint): allowlist grant and connectionString in query exhaustive-deps (#52334)
## Problem

`@tanstack/query/exhaustive-deps` flags every variable used in a
`queryFn` that isn't in the `queryKey`. Some variables are intentionally
left out because they don't change the returned data, and keeping them
out of the key avoids splitting the cache:

* **`connectionString`** in queries that run SQL against the user's
database. These currently need `eslint-disable` comments or count
against the ratchet.
* **`grant`**, the FGA grants that Studio data hooks now take (see
#52331). Every migrated query would otherwise need a disable comment.

The installed plugin (5.91.2) has no way to configure this.

## Solution

* Upgrade `@tanstack/eslint-plugin-query` from `^5.0.0` (resolving
5.91.2) to `^5.104.5`. The rule's `allowlist` option arrived in 5.95.0.
5.105.0 is newer than our pnpm minimum release age allows.
* Allowlist `grant` and `connectionString` for `exhaustive-deps` in
`eslint-config-supabase/next.js`.
* Remove the 11 disable comments in Studio that only suppressed
`connectionString`.
* Six disable comments stay, because they suppress other dependencies:
  * `ReportBlock.tsx`
  * `UserJourneys.queries.ts`
  * `github-config-query.ts`
  * `bucket-objects-infinite-query.ts`
  * `table-rows-query.ts`
  * `useSingleLog.tsx`
* Lower Studio's `@tanstack/query/exhaustive-deps` baseline from 87 to
28.

The upgraded rule is stricter than 5.91.2: without the allowlist it adds
about 18 warnings. With the allowlist, the total drops well below the
old baseline, because many existing warnings were unsuppressed
`connectionString` omissions.

The lockfile changes are the plugin and its `@typescript-eslint`
dependencies. The graphiql entries are re-keyed by pnpm's peer
resolution; their versions are unchanged.

## Testing

* `pnpm --filter studio run lint:ratchet` passes.
* ESLint is clean on each file where a disable comment was removed.
* Other apps' ratchets only track `shadcn/*` rules, so they're
unaffected.
2026-10-27 09:27:44 +01:00
..