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
29 changes: 29 additions & 0 deletions docs/router/eslint/eslint-plugin-router.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,32 @@ Alternatively, add `@tanstack/eslint-plugin-router` to the plugins section, and
The following rules are available in the TanStack Router ESLint Plugin:

- [@tanstack/router/create-route-property-order](../create-route-property-order.md)

## Conflicts with other ESLint plugins

If you have other ESLint plugins installed, they may rules that conflict with this plugin. If so, you'll need to make some tweaks to allow these plugins to work together.

### `typescript-eslint`

The [`@typescript-eslint/only-throw-error`](https://typescript-eslint.io/rules/only-throw-error/) rule, enabled by default in the `recommended-type-checked` and `strict-type-checked` rulesets, disallows the throwing of non-Error values as exceptions, which is considered a good practice.

To make sure it that it does not conflict with TanStack Router, you should add `redirect` to the allowed as a throwable objects.

```json
{
"rules": {
"@typescript-eslint/only-throw-error": [
"error",
{
"allow": [
{
"from": "package",
"package": "@tanstack/router-core",
"name": "Redirect"
}
]
}
]
}
}
```