Skip to content
This repository was archived by the owner on Apr 12, 2026. It is now read-only.

Repository files navigation

eslint-plugin-react-query-options

Warning

Most functionality of this plugin is already built-in in the official @tanstack/eslint-plugin-query package, see TanStack/query#10359

Eslint plugin for tanstack query to enforce using the queryOptions api inspired by this post from TkDodo

Usage

import reactQueryOptions from "eslint-plugin-react-query-options";

export default [
  // ...
  reactQueryOptions.configs.recommended,
];

Rules

💼 Configurations enabled in.
✅ Set in the recommended configuration.

Name                               Description 💼
invalidate-queries-no-inline-query Enforces queryClient.invalidateQueries don't have inline queries. Will error if queryKey or queryFn properties are passed to the function ✅
use-query-no-inline-query Enforces useQuery (and family) hooks use some form of query constructor pattern. Will error if queryKey or queryFn properties are passed to the hook ✅

Configs

Name
✅ recommended

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages