Skip to content

Eslint config suggested improvement #3045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
devinrhode2 opened this issue Dec 19, 2024 · 3 comments · May be fixed by TanStack/config#234
Closed

Eslint config suggested improvement #3045

devinrhode2 opened this issue Dec 19, 2024 · 3 comments · May be fixed by TanStack/config#234

Comments

@devinrhode2
Copy link

Which project does this relate to?

Router

Describe the bug

'@typescript-eslint/only-throw-error': [
  'error',
  {
    allow: ['Redirect'],
    allowThrowingAny: false,
    allowThrowingUnknown: false,
  },
],

Your Example Website or App

google.com

Steps to Reproduce the Bug or Issue

write throw redirect

Expected behavior

no eslint error when using strict @typescript-eslint config

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

@schiller-manuel
Copy link
Contributor

should this be put into the docs?

@SeanCassiere SeanCassiere added the documentation Everything documentation related label Dec 21, 2024
@chrisbenincasa
Copy link

chrisbenincasa commented Jan 24, 2025

Thanks for this! Also added NotFoundError to the list of allowed things to throw for the same reason.

@SeanCassiere
Copy link
Member

After some thought on this, I'm closing this, since this is more around a user's eslint setup. If you are using typescript-eslint's recommended setup, you wouldn't get this error from eslint.

The way to suppress this error is either turn off the rule, or change it to a warning. Both of which is done in the end user's eslint config.

We could document this in the Router docs, but this does not seem feasible considering that people could have other various rules in their configs that could also cause issues in their dev workflow.

A user customizing the eslint config's from upstream providers (like typescript-eslint, airbnb, antfu) to suite their project's requirements is quite common. This would fall into that category.

@SeanCassiere SeanCassiere closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants