eslint-plugin-react-query-options
v0.2.0
Published
Eslint plugin for tanstack query to enforce using the `queryOptions` api inspired by [this post](https://tkdodo.eu/blog/the-query-options-api) from TkDodo
Maintainers
Readme
eslint-plugin-react-query-options
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 |
