Sayonara pfp
Sayonara
@sayo
@darrylyeo does ai wrote good svelte?
3 replies
1 recast
1 reaction

Darryl Yeo 🛠️ pfp
Darryl Yeo 🛠️
@darrylyeo
Claude is getting quite decent at it. Still not perfect – needs a bit of nudging from system prompts, especially for the more recent syntax additions. Someone made a test suite called SvelteBench if you want to follow along: https://khromov.github.io/svelte-bench/benchmark-results-merged.html https://github.com/khromov/svelte-bench
2 replies
0 recast
2 reactions

Sayonara pfp
Sayonara
@sayo
Do you have any CLAUDE.md or other rules setup for svelte ?
1 reply
0 recast
1 reaction

Darryl Yeo 🛠️ pfp
Darryl Yeo 🛠️
@darrylyeo
This is mine: For Svelte: • keep value of `$state()` and `$derived()` indented on their own line • preserve existing double line breaks before comments in `<script>` • within `<script>`, annotate and order groups of imports and local definitions into sections as follows: Types/constants, Props, Functions, State, Actions, Components, Styles, Transitions/animations • within a section, sort imports by path, with types placed before values • always order as `<script>`, `<svelte:head>`, template markup, and `<style>`, with two empty lines between each • prefer `let { ... }: { ... } = $props()` over `let { ... } = $props<{ ... }>()`; comma after every destructured prop (except ...rest prop) • prefer inlining logic and derived variables that are only used once into the markup using `{@const}` • {@const} must be the immediate child of {#snippet}, {#if}, {:else if}, {:else}, {#each}, {:then}, {:catch}, <svelte:fragment>, <svelte:boundary> or <Component>
0 reply
1 recast
1 reaction