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

New rule: require-throws #566

Closed
0xCLARITY opened this issue Jun 4, 2020 · 2 comments
Closed

New rule: require-throws #566

0xCLARITY opened this issue Jun 4, 2020 · 2 comments

Comments

@0xCLARITY
Copy link
Contributor

Motivation

The same way we have require-returns and require-param, I think there would be value in a require-throws rule.

Current behavior

Currently, given a function that has a throw keyword, that throws an Error, I have no way to require documenting that the function throws an error using ESLint.

Desired behavior

If a function contains the throw keyword, require having a @throws in the JSDoc for the function.

Alternatives considered

@brettz9
Copy link
Collaborator

brettz9 commented Jun 4, 2020

Wouldn't catch all cases naturally, but would still be of good value. This might be a good first issue as one could follow the require-returns rule.

@brettz9
Copy link
Collaborator

brettz9 commented Jun 17, 2020

Closed by #574 . Thanks again!

@brettz9 brettz9 closed this as completed Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants