Skip to content

no-throw-statement Add option to allow throws inside async functions #323

@RebeccaStevens

Description

@RebeccaStevens

Throw statements inside an async function are essentially a type of return statement. They won't bubble up.

The following two functions are essentially identical:

async function foo() {
	throw new Error();
}

async function bar() {
	return Promise.reject(new Error());
}

@jonaskello What are your thoughts on potentially making this a default setting?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions