Skip to content

[no-throw-literal] Rename to only-throw-error #6109

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
4 tasks done
JoshuaKGoldberg opened this issue Nov 27, 2022 · 0 comments · Fixed by #8701
Closed
4 tasks done

[no-throw-literal] Rename to only-throw-error #6109

JoshuaKGoldberg opened this issue Nov 27, 2022 · 0 comments · Fixed by #8701
Assignees
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: plugin rule option New rule option for an existing eslint-plugin rule locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Milestone

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Nov 27, 2022

Before You File a Proposal Please Confirm You Have Done The Following...

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Link to the rule's documentation

https://typescript-eslint.io/rules/no-throw-literal/

Description

Per the docs:

This rule restricts what can be thrown as an exception. When it was first created, it only prevented literals from being thrown (hence the name), but it has now been expanded to only allow expressions which have a possibility of being an Error object.

We've got a v6 release coming up some. Maybe a good time to replacedBy-deprecate/rename to a more accurate name?

Edit: actually, this isn't a breaking change, as we can keep the old rule name aliasing the rule with replacedBy.

Additional Info

ESLint core's docs are https://eslint.org/docs/latest/rules/no-throw-literal.

@JoshuaKGoldberg JoshuaKGoldberg added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look enhancement: plugin rule option New rule option for an existing eslint-plugin rule breaking change This change will require a new major version to be released labels Nov 27, 2022
@bradzacher bradzacher added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Nov 27, 2022
@JoshuaKGoldberg JoshuaKGoldberg removed the breaking change This change will require a new major version to be released label Nov 28, 2022
@JoshuaKGoldberg JoshuaKGoldberg added this to the 7.0.0 milestone Jul 31, 2023
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Mar 17, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2024
@bradzacher bradzacher added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label Apr 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: plugin rule option New rule option for an existing eslint-plugin rule locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants