diff --git a/docs/HARNESS.md b/docs/HARNESS.md index e4a9627..e2d2bb3 100644 --- a/docs/HARNESS.md +++ b/docs/HARNESS.md @@ -85,9 +85,6 @@ ideally one rule per PR so the diff is reviewable: | Rule | Why warn today | Promote when | |---|---|---| -| `svelte/require-each-key` | ~10 unkeyed `{#each}` blocks | Each route owns its fix | -| `svelte/no-navigation-without-resolve` | ~10 `` / `goto()` without `resolve()` | Svelte 5 routing migration | -| `svelte/prefer-svelte-reactivity` | `new Set()` instead of `SvelteSet` in 2 files | Replace inline | | `no-useless-escape` | bash-template strings escape `\$` for shell interpolation | False-positive review — likely stay warn | ## What's intentionally NOT in the harness diff --git a/eslint.config.js b/eslint.config.js index f25836d..85364ed 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -65,15 +65,12 @@ export default [ 'no-useless-assignment': 'error', 'svelte/no-useless-mustaches': ['error', { ignoreStringEscape: true }], - // Style/best-practice rules that flag real-but-stylistic issues - // across the existing codebase. Soft-landed as warn so `validate` - // stays green; HARNESS.md documents the path to promote them. - 'svelte/require-each-key': 'warn', - 'svelte/no-navigation-without-resolve': 'warn', - 'svelte/prefer-svelte-reactivity': 'warn', - 'svelte/no-at-html-tags': 'warn', + 'svelte/require-each-key': 'error', + 'svelte/no-navigation-without-resolve': 'error', + 'svelte/prefer-svelte-reactivity': 'error', + 'svelte/no-at-html-tags': 'error', 'no-useless-escape': 'warn', - 'prefer-const': 'warn' + 'prefer-const': 'error' } }, @@ -82,6 +79,10 @@ export default [ languageOptions: { parser: svelteParser, parserOptions: { parser: tseslint.parser, extraFileExtensions: ['.svelte'] } + }, + rules: { + // One $props() destructuring can contain both bindable and readonly props. + 'prefer-const': ['error', { destructuring: 'all' }] } }, diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte index 6e9f58f..e710ca6 100644 --- a/src/lib/components/Button.svelte +++ b/src/lib/components/Button.svelte @@ -1,19 +1,21 @@ {#if href} - + {@render children()} {:else} diff --git a/src/lib/components/ConfigCard.svelte b/src/lib/components/ConfigCard.svelte index c713702..39fa85b 100644 --- a/src/lib/components/ConfigCard.svelte +++ b/src/lib/components/ConfigCard.svelte @@ -15,7 +15,7 @@ install_count?: number; } - let { config, username, onaction }: { + const { config, username, onaction }: { config: Config; username: string; onaction: (action: string, slug: string) => void; diff --git a/src/lib/components/ConfigDetail.svelte b/src/lib/components/ConfigDetail.svelte index 68a7528..149904a 100644 --- a/src/lib/components/ConfigDetail.svelte +++ b/src/lib/components/ConfigDetail.svelte @@ -1,5 +1,6 @@