Skip to content
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

Docs: no-unreachable is not necessarily handled by TypeScript #18378

Open
1 task done
benj-dobs opened this issue Apr 22, 2024 · 1 comment
Open
1 task done

Docs: no-unreachable is not necessarily handled by TypeScript #18378

benj-dobs opened this issue Apr 22, 2024 · 1 comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion documentation Relates to ESLint's documentation

Comments

@benj-dobs
Copy link

benj-dobs commented Apr 22, 2024

Docs page(s)

https://eslint.org/docs/latest/rules/no-unreachable#handled_by_typescript

What documentation issue do you want to solve?

The docs currently say:

It is safe to disable this rule when using TypeScript because TypeScript's compiler enforces this check.

This is only true if you have "allowUnreachableCode": false in your tsconfig.json. The default behaviour is just to surface an editor warning.

https://www.typescriptlang.org/tsconfig#allowUnreachableCode

What do you think is the correct solution?

If you are using TypeScript, the allowUnreachableCode compiler option offers an alternative to this rule.

Participation

  • I am willing to submit a pull request for this change.

Additional comments

No response

@nzakas
Copy link
Member

nzakas commented Apr 22, 2024

Always happy to make the documentation clearer. Please feel free to open a PR.

@nzakas nzakas added the accepted There is consensus among the team that this change meets the criteria for inclusion label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion documentation Relates to ESLint's documentation
Projects
Status: Ready to Implement
Development

No branches or pull requests

2 participants