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

chore: give verbose names to form args "e" #5983

Merged
merged 2 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilled-years-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-svelte": patch
---

make variable names more descriptive
14 changes: 7 additions & 7 deletions packages/create-svelte/templates/default/src/lib/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ export function enhance(
) {
let current_token: unknown;

/** @param {SubmitEvent} e */
async function handle_submit(e: SubmitEvent) {
/** @param {SubmitEvent} event */
async function handle_submit(event: SubmitEvent) {
const token = (current_token = {});

e.preventDefault();
event.preventDefault();

const data = new FormData(form);

Expand Down Expand Up @@ -92,11 +92,11 @@ export function enhance(
} else {
console.error(await response.text());
}
} catch (e: unknown) {
if (error && e instanceof Error) {
error({ data, form, error: e, response: null });
} catch (err: unknown) {
if (error && err instanceof Error) {
error({ data, form, error: err, response: null });
} else {
throw e;
throw err;
}
}
}
Expand Down