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

Add svelte/enhance-form warning #653

Open
LeoDog896 opened this issue Dec 17, 2023 · 0 comments
Open

Add svelte/enhance-form warning #653

LeoDog896 opened this issue Dec 17, 2023 · 0 comments
Labels
enhancement New feature or request new rule

Comments

@LeoDog896
Copy link

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

@LeoDog896 LeoDog896 added enhancement New feature or request new rule labels Dec 17, 2023
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