Skip to content
Open
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
6 changes: 6 additions & 0 deletions .changeset/shy-dryers-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@tanstack/eslint-config': minor
'@tanstack/config': minor
---

Permit `throw new Redirect` with @typescript-eslint's strict config
9 changes: 9 additions & 0 deletions packages/eslint-config/src/typescript.js
Original file line number Diff line number Diff line change
@@ -61,6 +61,15 @@ export const typescriptRules = {
'@typescript-eslint/no-unsafe-function-type': 'error',
/** Disallow using confusing built-in primitive class wrappers */
'@typescript-eslint/no-wrapper-object-types': 'error',
/** Permit `throw new Redirect` w/ @typescript-eslint's strict config */
'@typescript-eslint/only-throw-error': [
'warn', // Since this is meant for users of @typescript-eslint's strict config, I'm setting this to be an eslint "warning" instead of "error" - The goal is to be less aggressive, and get the PR merged – although one could argue this belongs in a new `@tanstack/ts-eslint-strict-config`, it's hard for me to justify that if it's literally just ONE rule.
{
allow: ['Redirect', 'NotFoundError'],
allowThrowingAny: false,
allowThrowingUnknown: false,
},
],
/** Enforce the use of as const over literal type */
'@typescript-eslint/prefer-as-const': 'error',
/** Prefer for-of loop over the standard for loop */