Skip to content

prefer-sveltekit-response-helpers #1217

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

Open
benmccann opened this issue May 14, 2025 · 0 comments
Open

prefer-sveltekit-response-helpers #1217

benmccann opened this issue May 14, 2025 · 0 comments
Labels
enhancement New feature or request new rule

Comments

@benmccann
Copy link
Member

benmccann commented May 14, 2025

Motivation

See lucia-auth/example-sveltekit-google-oauth#1 for an example

Description

Prefer using error and redirect over using Response. There might be some advanced cases where Response is required, but it shouldn't be for simple ones

Examples

<!-- ✓ GOOD -->
redirect(307, "/");

<!-- ✗ BAD -->
return new Response(null, {
	status: 307,
	headers: {
		Location: "/"
	}
});

Additional comments

No response

@benmccann benmccann added enhancement New feature or request new rule labels May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new rule
Projects
None yet
Development

No branches or pull requests

1 participant