Skip to content

Commit

Permalink
feat: update $inspect types (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
baseballyama committed Jan 21, 2024
1 parent d531e4e commit e27a3de
Show file tree
Hide file tree
Showing 27 changed files with 11,591 additions and 2,160 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-shoes-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"svelte-eslint-parser": patch
---

feat: update `$inspect` types
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"prettier-plugin-svelte": "^3.1.2",
"rimraf": "^5.0.5",
"semver": "^7.5.4",
"svelte": "^5.0.0-next.25",
"svelte": "^5.0.0-next.37",
"svelte2tsx": "^0.7.0",
"typescript": "~5.1.6",
"typescript-eslint-parser-for-extra-files": "^0.6.0"
Expand Down
2 changes: 1 addition & 1 deletion src/parser/typescript/analyze/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ function analyzeRuneVariables(
}
case "$inspect": {
appendDeclareFunctionVirtualScripts(globalName, [
`<T>(value: T, callback?: (value: T, type: 'init' | 'update') => void): void`,
`<T extends any[]>(...values: T): { with: (fn: (type: 'init' | 'update', ...values: T) => void) => void }`,
]);
break;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script>
let count = $state(0);
let message = $state("hello");
$inspect(count, message); // will console.log when `count` or `message` change
</script>

<button onclick="{() => count++}">Increment</button>
<input bind:value="{message}" />

0 comments on commit e27a3de

Please sign in to comment.