What's New
- Type narrowing in templates: Full support for discriminated unions,
{#if} / {:else if} chains, and {#each} blocks with proper type narrowing propagation
- SvelteKit integration: Automatic
PageData type annotations for route files and generated types discovery
- Snippet improvements: Proper narrowing context from
@render call sites, {@const} bindings inside snippet bodies, and optional parameter handling
- Component prop validation: Check required props, type mismatches, and
bind: prop types
- CSS vendor prefix diagnostics: Warn about compatibility issues with CSS vendor prefixes
- TypeScript file diagnostics: Report errors from all
.ts files in workspace, not just .svelte files
state_referenced_locally warning: Detect $state() variables referenced only in the defining scope
slot_element_deprecated warning: Warn about deprecated <slot> elements in Svelte 5 components
Bug Fixes
- Fix false positives for destructured
@const bindings and local types
- Fix
state_referenced_locally false positives for $bindable props, object property keys, and $props() rest patterns
- Fix import source mapping for files with leading comments or scattered imports
- Fix
typeof type hoisting and layout children prop handling
- Fix
style: directive parsing and skip custom action events
- Fix tsconfig filtering with relative workspace paths
- Fix snippet narrowing for
{:else if} branches and enclosing if conditions
- Emit
const for {@const} bindings to enable closure narrowing
- Preserve arrow function props for type checking
- Fix snippets in logic blocks not being treated as component props
- Respect
// svelte-ignore comments for state_referenced_locally
- Fix callback parameter type inference
- Transform Svelte 4 store assignment syntax to
set() calls
- Fix generic component props referencing out-of-scope type params
- Fix
{#each} binding scoping and destructuring with keyed expressions
- Fix class directive parsing for Tailwind class names with dots/brackets
- Handle pipe modifiers on transition directives
- Fix brace matching in attribute expressions with comments
- Import
Snippet type globally for Svelte 5 compatibility
- Fix discriminated union narrowing in template
if/else-if chains
- Detect unsupported TypeScript
enum and namespace features
Installation
brew install ampcode/tap/zvelte-check