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

@typescript-eslint/no-throw-literal: Enable allowThrowingUnknown option #51

Merged
merged 2 commits into from
Feb 9, 2022

Conversation

fregante
Copy link
Member

@fregante fregante commented Feb 9, 2022

This piece of configuration is currently blocking plain code like:

try {
	sorry()
} catch (error) {
	if (isCanadian(error)) {
		return;
	}

	throw error; // ERROR error
}

@sindresorhus
Copy link
Member

I think you should open an issue on the ESLint TypeScript project. Ideally, there should be an option called allowRethrowingUnknown. I think allowing throwing unknown in general is pretty unsafe, but I'm ok with allowing this for now.

@sindresorhus sindresorhus changed the title allowThrowingUnknown in @typescript-eslint/no-throw-literal @typescript-eslint/no-throw-literal: Enable allowThrowingUnknown option Feb 9, 2022
@sindresorhus sindresorhus merged commit 2b699f6 into xojs:main Feb 9, 2022
@fregante fregante deleted the patch-1 branch February 9, 2022 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants