Skip to content

Add svelte/enhance-form warning #653

Open
@tristan-f-r

Description

@tristan-f-r

Motivation

To stop developers from forgetting to enhance forms

Description

A rule that isn't on the recommended list (as sometimes, though I can't think of a case, a developer may want to implement it themselves) that ensures that all <form> elements have a use:enhance directive.

Examples

<script>
    import { enhance } from '$app/forms';
</script>

<!-- ✓ GOOD -->
<form method="POST" use:enhance>
<form use:enhance={{ ... }}>

<!-- ✗ BAD -->
<form>
<form method="POST">
<form use:otherMethod>

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions