Skip to content

Commit e27a3de

Browse files
authored
feat: update $inspect types (#467)
1 parent d531e4e commit e27a3de

27 files changed

+11591
-2160
lines changed

.changeset/ninety-shoes-clean.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte-eslint-parser": patch
3+
---
4+
5+
feat: update `$inspect` types

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"prettier-plugin-svelte": "^3.1.2",
105105
"rimraf": "^5.0.5",
106106
"semver": "^7.5.4",
107-
"svelte": "^5.0.0-next.25",
107+
"svelte": "^5.0.0-next.37",
108108
"svelte2tsx": "^0.7.0",
109109
"typescript": "~5.1.6",
110110
"typescript-eslint-parser-for-extra-files": "^0.6.0"

src/parser/typescript/analyze/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ function analyzeRuneVariables(
343343
}
344344
case "$inspect": {
345345
appendDeclareFunctionVirtualScripts(globalName, [
346-
`<T>(value: T, callback?: (value: T, type: 'init' | 'update') => void): void`,
346+
`<T extends any[]>(...values: T): { with: (fn: (type: 'init' | 'update', ...values: T) => void) => void }`,
347347
]);
348348
break;
349349
}

tests/fixtures/parser/ast/svelte5/docs/runes/11-$inspect-input.svelte

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script>
2+
let count = $state(0);
3+
let message = $state("hello");
4+
5+
$inspect(count, message); // will console.log when `count` or `message` change
6+
</script>
7+
8+
<button onclick="{() => count++}">Increment</button>
9+
<input bind:value="{message}" />

0 commit comments

Comments
 (0)