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

Latest commit

 

History

History
43 lines (29 loc) · 1.91 KB

File metadata and controls

43 lines (29 loc) · 1.91 KB

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