📄 tanstack/query/v4/docs/eslint/eslint-plugin-query

File: eslint-plugin-query.md | Updated: 11/15/2025

Source: https://tanstack.com/query/v4/docs/eslint/eslint-plugin-query



TanStack

Query v4v4

Search...

+ K

Auto

Log In

TanStack StartRC

Docs Examples GitHub Contributors

TanStack Router

Docs Examples GitHub Contributors

TanStack Query

Docs Examples GitHub Contributors

TanStack Table

Docs Examples Github Contributors

TanStack Formnew

Docs Examples Github Contributors

TanStack DBbeta

Docs Github Contributors

TanStack Virtual

Docs Examples Github Contributors

TanStack Paceralpha

Docs Examples Github Contributors

TanStack Storealpha

Docs Examples Github Contributors

TanStack Devtoolsalpha

Docs Github Contributors

More Libraries

Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide

Documentation

Framework

React logo

React

Version

v4

Search...

+ K

Menu

Getting Started

Guides & Concepts

Community Resources

API Reference

ESLint

Plugins

Examples

Framework

React logo

React

Version

v4

Menu

Getting Started

Guides & Concepts

Community Resources

API Reference

ESLint

Plugins

Examples

On this page

ESLint Plugin Query

Copy Markdown

TanStack Query comes with its own ESLint plugin. This plugin is used to enforce best practices and to help you avoid common mistakes.

Installation
------------

The plugin is a separate package that you need to install:

bash

npm i -D @tanstack/eslint-plugin-query@4


npm i -D @tanstack/eslint-plugin-query@4

or

bash

pnpm add -D @tanstack/eslint-plugin-query@4


pnpm add -D @tanstack/eslint-plugin-query@4

or

bash

yarn add -D @tanstack/eslint-plugin-query@4


yarn add -D @tanstack/eslint-plugin-query@4

Usage
-----

Add @tanstack/eslint-plugin-query to the plugins section of your .eslintrc configuration file:

json

{
  "plugins": ["@tanstack/query"]
}


{
  "plugins": ["@tanstack/query"]
}

Then configure the rules you want to use under the rules section:

json

{
  "rules": {
    "@tanstack/query/exhaustive-deps": "error",
    "@tanstack/query/no-deprecated-options": "error",
    "@tanstack/query/prefer-query-object-syntax": "error",
    "@tanstack/query/stable-query-client": "error"
  }
}


{
  "rules": {
    "@tanstack/query/exhaustive-deps": "error",
    "@tanstack/query/no-deprecated-options": "error",
    "@tanstack/query/prefer-query-object-syntax": "error",
    "@tanstack/query/stable-query-client": "error"
  }
}

### Recommended config

You can also enable all the recommended rules for our plugin. Add plugin:@tanstack/eslint-plugin-query/recommended in extends:

json

{
  "extends": ["plugin:@tanstack/eslint-plugin-query/recommended"]
}


{
  "extends": ["plugin:@tanstack/eslint-plugin-query/recommended"]
}

Edit on GitHub

hydration

Exhaustive Deps

Partners Become a Partner

Code RabbitCode Rabbit CloudflareCloudflare AG GridAG Grid NetlifyNetlify NeonNeon WorkOSWorkOS ClerkClerk ConvexConvex ElectricElectric SentrySentry PrismaPrisma StrapiStrapi UnkeyUnkey

[###### Want to Skip the Docs?

Query.gg - The Official React Query Course
\

“If you’re serious about *really* understanding React Query, there’s no better way than with query.gg”—Tanner Linsley

Learn More](https://query.gg/?s=tanstack)

You are currently reading v4 docs. Redirect to latest version?

Latest Hide

scarf analytics