Skip to content

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

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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.

Metadata

Metadata

Labels

accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions