Skip to content

Commit a69d430

Browse files
KATO-Hiroclaude
andcommitted
docs: Clarify redirect behavior in API routes and store migration requirement
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0ab9aa9 commit a69d430

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

.claude/rules/coding-style.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Common identifiers: `typescript`, `svelte`, `sql`, `bash`, `mermaid`, `json`, `p
2222
## SvelteKit: Routes vs API Endpoints
2323

2424
- Page routes (`+page.server.ts`): use `redirect()` to navigate
25-
- API routes (`+server.ts`): use `error()` — throwing `redirect()` causes `fetch` clients to receive HTML instead of a JSON error
25+
- API routes (`+server.ts`): use `error()` — throwing `redirect()` returns a 3xx response; `fetch` follows it by default and receives the HTML page at the redirect target instead of a JSON error
2626

2727
## Dual-Enforcement Constraints
2828

.claude/rules/svelte-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Use `$props()`, `$state()`, `$derived()`, `$effect()` in all components. Props p
2525
## File Naming
2626

2727
- Components: `PascalCase.svelte`
28-
- Stores: `snake_case.svelte.ts` in `src/lib/stores/`, class-based with `$state()`, export singleton
28+
- Stores: `snake_case.svelte.ts` in `src/lib/stores/`, class-based with `$state()`, export singleton. Pre-Runes stores (using `writable()`, `.ts` extension) must be migrated to this pattern before adding features or extending them.
2929

3030
## Flowbite Svelte
3131

0 commit comments

Comments
 (0)