Skip to content

Commit a91c11b

Browse files
committed
docs: add usage example
1 parent 1598daf commit a91c11b

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
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
44

5+
## Usage
6+
7+
```js
8+
import eslintPluginReactQueryOptions from "eslint-plugin-react-query-options";
9+
10+
export default [
11+
// ...
12+
eslintPluginReactQueryOptions.configs.recommended,
13+
];
14+
```
15+
16+
## Rules
17+
518
<!-- prettier-ignore-start -->
619
<!-- begin auto-generated rules list -->
720

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import requireQueryOptions from "./rules/require-query-options.js";
22
import pkg from "../package.json" with { type: "json" };
33

4-
const plugin = {
4+
const eslintPluginReactQueryOptions = {
55
meta: {
66
name: pkg.name,
77
version: pkg.version,
@@ -19,7 +19,7 @@ const configs = {
1919
recommended: [
2020
{
2121
plugins: {
22-
"react-query-options": plugin,
22+
"react-query-options": eslintPluginReactQueryOptions,
2323
},
2424
rules: {
2525
"react-query-options/require-query-options": "error",
@@ -28,4 +28,4 @@ const configs = {
2828
],
2929
};
3030

31-
export default plugin;
31+
export default eslintPluginReactQueryOptions;

0 commit comments

Comments
 (0)