Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions docs/eslint/eslint-plugin-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,61 @@ Alternatively, add `@tanstack/query` to the plugins section, and configure the r
}
```

## Oxlint

The plugin can also be used with [Oxlint](https://oxc.rs/docs/guide/usage/linter) through its [JS plugins](https://oxc.rs/docs/guide/usage/linter/js-plugins) support, which is currently in alpha. Rule names are the same as in ESLint.

### `oxlint.config.ts`

#### Recommended setup

To enable all of the recommended rules for our plugin, add the plugin to `jsPlugins` and spread the rules of the `recommended` config:

```ts
import { defineConfig } from 'oxlint'
import pluginQuery from '@tanstack/eslint-plugin-query'

export default defineConfig({
jsPlugins: ['@tanstack/eslint-plugin-query'],
rules: {
...pluginQuery.configs.recommended.rules,
},
})
```

Use `pluginQuery.configs.recommendedStrict.rules` instead for the recommended strict setup.

#### Custom setup

Alternatively, configure only the rules you want to use:

```ts
import { defineConfig } from 'oxlint'

export default defineConfig({
jsPlugins: ['@tanstack/eslint-plugin-query'],
rules: {
'@tanstack/query/exhaustive-deps': 'error',
},
})
```

### `.oxlintrc.json`

A JSON config cannot import the configs of our plugin, so add the plugin to `jsPlugins` and configure the rules you want to use:

```json
{
"jsPlugins": ["@tanstack/eslint-plugin-query"],
"rules": {
"@tanstack/query/exhaustive-deps": "error"
}
}
```

> [!NOTE]
> [`no-void-query-fn`](./no-void-query-fn.md) needs type information, which Oxlint does not provide to JS plugins yet, so the rule does not report anything under Oxlint.
## Rules

- [@tanstack/query/exhaustive-deps](./exhaustive-deps.md)
Expand Down
Loading