From 3b2c62b2bafa22ec1251968c5969a7006ae61fb9 Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Mon, 8 Apr 2024 07:36:37 +0900 Subject: [PATCH] feat: add support for `$bindable` rune & update deps (#498) --- .changeset/great-meals-travel.md | 5 + package.json | 36 +- src/parser/globals.ts | 1 + src/parser/typescript/analyze/index.ts | 11 + .../ast/$$slots-scope-output-svelte5.json | 6 + .../10-scope-output-svelte5.json | 6 + .../11-scope-output-svelte5.json | 6 + .../02-$$slots/01-scope-output-svelte5.json | 6 + .../example01-scope-output.json | 6 + .../functions/01-untrack-scope-output.json | 6 + .../old-vs-new/01-counter-scope-output.json | 6 + ...02-tracking-dependencies-scope-output.json | 6 + ...-untracking-dependencies-scope-output.json | 6 + ...4-simple-component-props-scope-output.json | 6 + ...advanced-component-props-scope-output.json | 6 + .../06-autoscroll-scope-output.json | 6 + .../runes/01-$state-frozen-scope-output.json | 6 + .../docs/runes/01-$state-scope-output.json | 6 + .../docs/runes/02-$derived-scope-output.json | 6 + .../runes/02-2-$derived-by-scope-output.json | 6 + .../docs/runes/03-$effect-scope-output.json | 6 + .../runes/04-$effect-pre-scope-output.json | 6 + .../docs/runes/05-$props-scope-output.json | 6 + .../docs/runes/06-$props-scope-output.json | 6 + .../docs/runes/07-$props-scope-output.json | 6 + .../docs/runes/08-$props-ts-scope-output.json | 6 + .../docs/runes/08-2-$bindable-input.svelte | 3 + .../08-2-$bindable-no-unused-vars-result.json | 8 + .../docs/runes/08-2-$bindable-output.json | 660 ++++++++++ .../08-2-$bindable-prefer-const-result.json | 8 + .../runes/08-2-$bindable-scope-output.json | 605 ++++++++++ .../docs/runes/08-3-$bindable-input.svelte | 3 + .../08-3-$bindable-no-unused-vars-result.json | 8 + .../docs/runes/08-3-$bindable-output.json | 698 +++++++++++ .../08-3-$bindable-prefer-const-result.json | 8 + .../runes/08-3-$bindable-scope-output.json | 625 ++++++++++ .../docs/runes/08-4-$bindable-ts-input.svelte | 3 + ...-4-$bindable-ts-no-unused-vars-result.json | 8 + .../docs/runes/08-4-$bindable-ts-output.json | 1059 +++++++++++++++++ ...08-4-$bindable-ts-prefer-const-result.json | 8 + .../runes/08-4-$bindable-ts-scope-output.json | 731 ++++++++++++ .../runes/09-how-to-opt-in-scope-output.json | 6 + .../runes/10-$effect-root-scope-output.json | 6 + .../runes/11-1-$inspect-scope-output.json | 6 + .../runes/11-1-$inspect-ts-scope-output.json | 6 + .../runes/11-2-$inspect-scope-output.json | 6 + .../runes/11-2-$inspect-ts-scope-output.json | 6 + .../runes/11-3-$inspect-scope-output.json | 6 + .../runes/11-3-$inspect-ts-scope-output.json | 6 + .../docs/runes/12-$inspect-scope-output.json | 6 + .../docs/runes/13-$inspect-scope-output.json | 6 + .../docs/snippets/01-scope-output.json | 6 + .../docs/snippets/02-scope-output.json | 6 + .../03-snippet-scope-scope-output.json | 6 + .../04-snippet-scope-scope-output.json | 6 + .../05-snippet-scope-scope-output.json | 6 + ...g-snippets-to-components-scope-output.json | 6 + ...g-snippets-to-components-scope-output.json | 6 + ...g-snippets-to-components-scope-output.json | 6 + ...g-snippets-to-components-scope-output.json | 6 + .../10-typing-snippets-scope-output.json | 6 + .../11-typing-snippets-scope-output.json | 6 + .../universal-reactivity/01-scope-output.json | 6 + .../universal-reactivity/02-scope-output.json | 6 + .../universal-reactivity/03-scope-output.json | 6 + .../03-ts-scope-output.json | 6 + .../generics01-snippets-scope-output.json | 6 + .../ast/svelte5/render01-scope-output.json | 6 + .../render02-optional-scope-output.json | 6 + .../svelte5/snippet01-hoist-scope-output.json | 6 + .../svelte-ts-$derived01-scope-output.json | 6 + .../svelte-ts-$effect01-scope-output.json | 6 + .../svelte-ts-$props01-scope-output.json | 6 + .../ts-$derived-by01-scope-output.json | 6 + .../svelte5/ts-$derived01-scope-output.json | 6 + .../svelte5/ts-$effect01-scope-output.json | 6 + .../svelte5/ts-$effectpre01-scope-output.json | 6 + .../ast/svelte5/ts-$props01-scope-output.json | 6 + .../ts-$state-flozen01-scope-output.json | 6 + .../ast/svelte5/ts-$state01-scope-output.json | 6 + .../ast/svelte5/ts-event01-scope-output.json | 6 + .../ast/svelte5/ts-event02-scope-output.json | 6 + .../ast/svelte5/ts-event03-scope-output.json | 6 + .../ast/svelte5/ts-event04-scope-output.json | 6 + .../ast/svelte5/ts-event05-scope-output.json | 6 + .../ast/svelte5/ts-event06-scope-output.json | 6 + .../ast/svelte5/ts-event07-scope-output.json | 6 + .../ast/svelte5/ts-event08-scope-output.json | 6 + .../svelte5/ts-snippet01-scope-output.json | 6 + .../ts-snippet02-hoist-scope-output.json | 6 + .../ts-$$props01-scope-output-svelte5.json | 6 + .../ts-$$slots01-scope-output-svelte5.json | 6 + ...$slots02-no-slot-scope-output-svelte5.json | 6 + ...-$$slots03-named-scope-output-svelte5.json | 6 + ...-$$slots04-named-scope-output-svelte5.json | 6 + ...optional-slots03-scope-output-svelte5.json | 6 + tests/src/parser/test-utils.ts | 6 + 97 files changed, 4938 insertions(+), 18 deletions(-) create mode 100644 .changeset/great-meals-travel.md create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-no-unused-vars-result.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-prefer-const-result.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-scope-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-no-unused-vars-result.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-prefer-const-result.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-scope-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-no-unused-vars-result.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-prefer-const-result.json create mode 100644 tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-scope-output.json diff --git a/.changeset/great-meals-travel.md b/.changeset/great-meals-travel.md new file mode 100644 index 00000000..17ef4b57 --- /dev/null +++ b/.changeset/great-meals-travel.md @@ -0,0 +1,5 @@ +--- +"svelte-eslint-parser": minor +--- + +feat: add support for `$bindable` rune diff --git a/package.json b/package.json index 41c5254f..483b9084 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "version:ci": "env-cmd -e version-ci pnpm run build:meta && changeset version" }, "peerDependencies": { - "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.69" + "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.94" }, "peerDependenciesMeta": { "svelte": { @@ -58,46 +58,46 @@ "eslint-scope": "^7.2.2", "eslint-visitor-keys": "^3.4.3", "espree": "^9.6.1", - "postcss": "^8.4.35", + "postcss": "^8.4.38", "postcss-scss": "^4.0.9" }, "devDependencies": { "@changesets/changelog-github": "^0.5.0", "@changesets/cli": "^2.27.1", "@changesets/get-release-plan": "^4.0.0", - "@ota-meshi/eslint-plugin": "^0.15.2", + "@ota-meshi/eslint-plugin": "^0.15.3", "@types/benchmark": "^2.1.5", - "@types/chai": "^4.3.12", - "@types/eslint": "^8.56.5", + "@types/chai": "^4.3.14", + "@types/eslint": "^8.56.7", "@types/eslint-scope": "^3.7.7", - "@types/eslint-visitor-keys": "^3.0.0", + "@types/eslint-visitor-keys": "^3.3.0", "@types/estree": "^1.0.5", "@types/mocha": "^10.0.6", - "@types/node": "^20.11.22", + "@types/node": "^20.12.5", "@types/semver": "^7.5.8", - "@typescript-eslint/eslint-plugin": "^7.1.0", + "@typescript-eslint/eslint-plugin": "^7.5.0", "@typescript-eslint/parser": "~7.5.0", "@typescript-eslint/types": "~7.5.0", "benchmark": "^2.1.4", "chai": "^4.4.1", "env-cmd": "^10.1.0", - "esbuild": "^0.20.1", + "esbuild": "^0.20.2", "esbuild-register": "^3.5.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-json-schema-validator": "^5.0.0", - "eslint-plugin-jsonc": "^2.13.0", + "eslint-plugin-json-schema-validator": "^5.1.0", + "eslint-plugin-jsonc": "^2.15.0", "eslint-plugin-n": "^16.6.2", "eslint-plugin-node-dependencies": "^0.11.2", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-regexp": "^2.2.0", + "eslint-plugin-regexp": "^2.4.0", "eslint-plugin-svelte": "^2.35.1", - "eslint-plugin-yml": "^1.12.2", + "eslint-plugin-yml": "^1.14.0", "estree-walker": "^3.0.3", "locate-character": "^3.0.0", - "magic-string": "^0.30.7", - "mocha": "^10.3.0", + "magic-string": "^0.30.9", + "mocha": "^10.4.0", "mocha-chai-jest-snapshot": "^1.1.4", "nyc": "^15.1.0", "prettier": "~3.2.5", @@ -105,9 +105,9 @@ "prettier-plugin-svelte": "^3.2.2", "rimraf": "^5.0.5", "semver": "^7.6.0", - "svelte": "^5.0.0-next.69", - "svelte2tsx": "^0.7.3", - "typescript": "~5.4.0", + "svelte": "^5.0.0-next.94", + "svelte2tsx": "^0.7.6", + "typescript": "~5.4.4", "typescript-eslint-parser-for-extra-files": "^0.6.0" }, "publishConfig": { diff --git a/src/parser/globals.ts b/src/parser/globals.ts index e1e528ad..c8b24fb3 100644 --- a/src/parser/globals.ts +++ b/src/parser/globals.ts @@ -6,6 +6,7 @@ export const globalsForRunes = [ "$derived", "$effect", "$props", + "$bindable", "$inspect", ] as const; const globalsForSvelte5 = [...globalsForSvelte4, ...globalsForRunes]; diff --git a/src/parser/typescript/analyze/index.ts b/src/parser/typescript/analyze/index.ts index 51c9f01a..c2f332ec 100644 --- a/src/parser/typescript/analyze/index.ts +++ b/src/parser/typescript/analyze/index.ts @@ -260,6 +260,7 @@ function analyzeDollarDollarVariables( case "$derived": case "$effect": case "$props": + case "$bindable": case "$inspect": // Processed by `analyzeRuneVariables`. break; @@ -317,6 +318,7 @@ function analyzeRuneVariables( continue; } switch (globalName) { + // See https://github.com/sveltejs/svelte/blob/dfc55c18f010f620b966e13eb0ad1f9791b5798f/packages/svelte/types/index.d.ts#L2492 case "$state": { appendDeclareFunctionVirtualScripts(globalName, [ "(initial: T): T", @@ -328,6 +330,7 @@ function analyzeRuneVariables( ]); break; } + // See https://github.com/sveltejs/svelte/blob/dfc55c18f010f620b966e13eb0ad1f9791b5798f/packages/svelte/types/index.d.ts#L2535 case "$derived": { appendDeclareFunctionVirtualScripts(globalName, [ "(expression: T): T", @@ -337,6 +340,7 @@ function analyzeRuneVariables( ]); break; } + // See https://github.com/sveltejs/svelte/blob/dfc55c18f010f620b966e13eb0ad1f9791b5798f/packages/svelte/types/index.d.ts#L2574 case "$effect": { appendDeclareFunctionVirtualScripts(globalName, [ "(fn: () => void | (() => void)): void", @@ -348,10 +352,17 @@ function analyzeRuneVariables( ]); break; } + // See https://github.com/sveltejs/svelte/blob/dfc55c18f010f620b966e13eb0ad1f9791b5798f/packages/svelte/types/index.d.ts#L2655 case "$props": { appendDeclareFunctionVirtualScripts(globalName, ["(): T"]); break; } + // See https://github.com/sveltejs/svelte/blob/dfc55c18f010f620b966e13eb0ad1f9791b5798f/packages/svelte/types/index.d.ts#L2666 + case "$bindable": { + appendDeclareFunctionVirtualScripts(globalName, ["(t?: T): T"]); + break; + } + // See https://github.com/sveltejs/svelte/blob/dfc55c18f010f620b966e13eb0ad1f9791b5798f/packages/svelte/types/index.d.ts#L2686 case "$inspect": { appendDeclareFunctionVirtualScripts(globalName, [ `(...values: T): { with: (fn: (type: 'init' | 'update', ...values: T) => void) => void }`, diff --git a/tests/fixtures/parser/ast/$$slots-scope-output-svelte5.json b/tests/fixtures/parser/ast/$$slots-scope-output-svelte5.json index d9f29c65..d13c2860 100644 --- a/tests/fixtures/parser/ast/$$slots-scope-output-svelte5.json +++ b/tests/fixtures/parser/ast/$$slots-scope-output-svelte5.json @@ -66,6 +66,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/10-scope-output-svelte5.json b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/10-scope-output-svelte5.json index 131c8df6..39b2e4c4 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/10-scope-output-svelte5.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/10-scope-output-svelte5.json @@ -66,6 +66,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/11-scope-output-svelte5.json b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/11-scope-output-svelte5.json index dcfd31e2..1b74fba7 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/11-scope-output-svelte5.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/11-scope-output-svelte5.json @@ -66,6 +66,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/02-$$slots/01-scope-output-svelte5.json b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/02-$$slots/01-scope-output-svelte5.json index a19fa7b6..f1ff0258 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/02-$$slots/01-scope-output-svelte5.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/02-$$slots/01-scope-output-svelte5.json @@ -66,6 +66,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/fine-grained-reactivity/example01-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/fine-grained-reactivity/example01-scope-output.json index 99ddfa91..94f36bf8 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/fine-grained-reactivity/example01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/fine-grained-reactivity/example01-scope-output.json @@ -113,6 +113,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/functions/01-untrack-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/functions/01-untrack-scope-output.json index f10dd254..200d90d6 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/functions/01-untrack-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/functions/01-untrack-scope-output.json @@ -91,6 +91,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/01-counter-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/01-counter-scope-output.json index 060bdff2..a06baacb 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/01-counter-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/01-counter-scope-output.json @@ -115,6 +115,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/02-tracking-dependencies-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/02-tracking-dependencies-scope-output.json index 3bb3ec4d..3778f48c 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/02-tracking-dependencies-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/02-tracking-dependencies-scope-output.json @@ -114,6 +114,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/03-untracking-dependencies-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/03-untracking-dependencies-scope-output.json index 2922ca84..adcd7a8a 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/03-untracking-dependencies-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/03-untracking-dependencies-scope-output.json @@ -114,6 +114,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/04-simple-component-props-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/04-simple-component-props-scope-output.json index 1e3331d4..76f0ca39 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/04-simple-component-props-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/04-simple-component-props-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/05-advanced-component-props-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/05-advanced-component-props-scope-output.json index 14b15863..909037e0 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/05-advanced-component-props-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/05-advanced-component-props-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/06-autoscroll-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/06-autoscroll-scope-output.json index f04a915b..4c830220 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/06-autoscroll-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/06-autoscroll-scope-output.json @@ -114,6 +114,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/01-$state-frozen-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/01-$state-frozen-scope-output.json index 6ff87735..c05d83f1 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/01-$state-frozen-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/01-$state-frozen-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/01-$state-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/01-$state-scope-output.json index 79e0b079..b456bc01 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/01-$state-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/01-$state-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/02-$derived-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/02-$derived-scope-output.json index bbbdf563..abe0cb6b 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/02-$derived-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/02-$derived-scope-output.json @@ -91,6 +91,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/02-2-$derived-by-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/02-2-$derived-by-scope-output.json index 75ed1aa4..8cc7c8a3 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/02-2-$derived-by-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/02-2-$derived-by-scope-output.json @@ -91,6 +91,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/03-$effect-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/03-$effect-scope-output.json index 956a1a7e..98b9012f 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/03-$effect-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/03-$effect-scope-output.json @@ -115,6 +115,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/04-$effect-pre-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/04-$effect-pre-scope-output.json index 4ab6c27f..9bd952ca 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/04-$effect-pre-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/04-$effect-pre-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/05-$props-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/05-$props-scope-output.json index e90d6d99..e02632de 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/05-$props-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/05-$props-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/06-$props-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/06-$props-scope-output.json index fd59558c..b8db2a2d 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/06-$props-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/06-$props-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/07-$props-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/07-$props-scope-output.json index 237784fc..2b43d00d 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/07-$props-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/07-$props-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-ts-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-ts-scope-output.json index 71013d2e..56e7dcd3 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-ts-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-ts-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-input.svelte b/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-input.svelte new file mode 100644 index 00000000..f0f804bd --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-input.svelte @@ -0,0 +1,3 @@ + diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-no-unused-vars-result.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-no-unused-vars-result.json new file mode 100644 index 00000000..5b4d90df --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-no-unused-vars-result.json @@ -0,0 +1,8 @@ +[ + { + "ruleId": "no-unused-vars", + "code": "bindableProp", + "line": 2, + "column": 8 + } +] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-output.json new file mode 100644 index 00000000..dd567583 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-output.json @@ -0,0 +1,660 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + "body": [ + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "AssignmentPattern", + "left": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "right": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "optional": false, + "range": [ + 31, + 42 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 33 + } + } + }, + "range": [ + 16, + 42 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 33 + } + } + }, + "range": [ + 16, + 42 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 33 + } + } + } + ], + "range": [ + 14, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 47, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 44 + } + } + }, + "optional": false, + "range": [ + 47, + 55 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 46 + } + } + }, + "range": [ + 14, + 55 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 46 + } + } + } + ], + "range": [ + 10, + 56 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 47 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 57, + 66 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "range": [ + 0, + 66 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 10, + 13 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 14, + 15 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 29, + 30 + ], + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + } + }, + { + "type": "Identifier", + "value": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 40, + 41 + ], + "loc": { + "start": { + "line": 2, + "column": 31 + }, + "end": { + "line": 2, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 41, + 42 + ], + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 43, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 34 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 45, + 46 + ], + "loc": { + "start": { + "line": 2, + "column": 36 + }, + "end": { + "line": 2, + "column": 37 + } + } + }, + { + "type": "Identifier", + "value": "$props", + "range": [ + 47, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 44 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 53, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 44 + }, + "end": { + "line": 2, + "column": 45 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 54, + 55 + ], + "loc": { + "start": { + "line": 2, + "column": 45 + }, + "end": { + "line": 2, + "column": 46 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 55, + 56 + ], + "loc": { + "start": { + "line": 2, + "column": 46 + }, + "end": { + "line": 2, + "column": 47 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 57, + 58 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 58, + 59 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 59, + 65 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 65, + 66 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + } + } + ], + "range": [ + 0, + 67 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 0 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-prefer-const-result.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-prefer-const-result.json new file mode 100644 index 00000000..ecab88c6 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-prefer-const-result.json @@ -0,0 +1,8 @@ +[ + { + "ruleId": "prefer-const", + "code": "bindableProp", + "line": 2, + "column": 8 + } +] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-scope-output.json new file mode 100644 index 00000000..16502557 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-2-$bindable-scope-output.json @@ -0,0 +1,605 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 47, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 44 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "bindableProp", + "identifiers": [ + { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "AssignmentPattern", + "left": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "right": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "optional": false, + "range": [ + 31, + 42 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 33 + } + } + }, + "range": [ + 16, + 42 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 33 + } + } + }, + "range": [ + 16, + 42 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 33 + } + } + } + ], + "range": [ + 14, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 47, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 44 + } + } + }, + "optional": false, + "range": [ + 47, + 55 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 46 + } + } + }, + "range": [ + 14, + 55 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 46 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 47, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 44 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 47, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 44 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-input.svelte b/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-input.svelte new file mode 100644 index 00000000..49dd38c5 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-input.svelte @@ -0,0 +1,3 @@ + diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-no-unused-vars-result.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-no-unused-vars-result.json new file mode 100644 index 00000000..5b4d90df --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-no-unused-vars-result.json @@ -0,0 +1,8 @@ +[ + { + "ruleId": "no-unused-vars", + "code": "bindableProp", + "line": 2, + "column": 8 + } +] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-output.json new file mode 100644 index 00000000..6a7cea6d --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-output.json @@ -0,0 +1,698 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + "body": [ + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "AssignmentPattern", + "left": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'fallback'", + "value": "fallback", + "range": [ + 41, + 51 + ], + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 42 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "optional": false, + "range": [ + 31, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 43 + } + } + }, + "range": [ + 16, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 43 + } + } + }, + "range": [ + 16, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 43 + } + } + } + ], + "range": [ + 14, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 45 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 57, + 63 + ], + "loc": { + "start": { + "line": 2, + "column": 48 + }, + "end": { + "line": 2, + "column": 54 + } + } + }, + "optional": false, + "range": [ + 57, + 65 + ], + "loc": { + "start": { + "line": 2, + "column": 48 + }, + "end": { + "line": 2, + "column": 56 + } + } + }, + "range": [ + 14, + 65 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 56 + } + } + } + ], + "range": [ + 10, + 66 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 57 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 67, + 76 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "range": [ + 0, + 76 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 10, + 13 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 14, + 15 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 29, + 30 + ], + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + } + }, + { + "type": "Identifier", + "value": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 40, + 41 + ], + "loc": { + "start": { + "line": 2, + "column": 31 + }, + "end": { + "line": 2, + "column": 32 + } + } + }, + { + "type": "String", + "value": "'fallback'", + "range": [ + 41, + 51 + ], + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 42 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 51, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 42 + }, + "end": { + "line": 2, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 53, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 44 + }, + "end": { + "line": 2, + "column": 45 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 55, + 56 + ], + "loc": { + "start": { + "line": 2, + "column": 46 + }, + "end": { + "line": 2, + "column": 47 + } + } + }, + { + "type": "Identifier", + "value": "$props", + "range": [ + 57, + 63 + ], + "loc": { + "start": { + "line": 2, + "column": 48 + }, + "end": { + "line": 2, + "column": 54 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 63, + 64 + ], + "loc": { + "start": { + "line": 2, + "column": 54 + }, + "end": { + "line": 2, + "column": 55 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 64, + 65 + ], + "loc": { + "start": { + "line": 2, + "column": 55 + }, + "end": { + "line": 2, + "column": 56 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 65, + 66 + ], + "loc": { + "start": { + "line": 2, + "column": 56 + }, + "end": { + "line": 2, + "column": 57 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 67, + 68 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 68, + 69 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 69, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 75, + 76 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + } + } + ], + "range": [ + 0, + 77 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 0 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-prefer-const-result.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-prefer-const-result.json new file mode 100644 index 00000000..ecab88c6 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-prefer-const-result.json @@ -0,0 +1,8 @@ +[ + { + "ruleId": "prefer-const", + "code": "bindableProp", + "line": 2, + "column": 8 + } +] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-scope-output.json new file mode 100644 index 00000000..6edb3386 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-3-$bindable-scope-output.json @@ -0,0 +1,625 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 57, + 63 + ], + "loc": { + "start": { + "line": 2, + "column": 48 + }, + "end": { + "line": 2, + "column": 54 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "bindableProp", + "identifiers": [ + { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "AssignmentPattern", + "left": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'fallback'", + "value": "fallback", + "range": [ + 41, + 51 + ], + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 42 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "optional": false, + "range": [ + 31, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 43 + } + } + }, + "range": [ + 16, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 43 + } + } + }, + "range": [ + 16, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 43 + } + } + } + ], + "range": [ + 14, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 45 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 57, + 63 + ], + "loc": { + "start": { + "line": 2, + "column": 48 + }, + "end": { + "line": 2, + "column": 54 + } + } + }, + "optional": false, + "range": [ + 57, + 65 + ], + "loc": { + "start": { + "line": 2, + "column": 48 + }, + "end": { + "line": 2, + "column": 56 + } + } + }, + "range": [ + 14, + 65 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 56 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 16, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 57, + 63 + ], + "loc": { + "start": { + "line": 2, + "column": 48 + }, + "end": { + "line": 2, + "column": 54 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 31, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 57, + 63 + ], + "loc": { + "start": { + "line": 2, + "column": 48 + }, + "end": { + "line": 2, + "column": 54 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-input.svelte b/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-input.svelte new file mode 100644 index 00000000..96887788 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-input.svelte @@ -0,0 +1,3 @@ + diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-no-unused-vars-result.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-no-unused-vars-result.json new file mode 100644 index 00000000..5b4d90df --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-no-unused-vars-result.json @@ -0,0 +1,8 @@ +[ + { + "ruleId": "no-unused-vars", + "code": "bindableProp", + "line": 2, + "column": 8 + } +] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-output.json new file mode 100644 index 00000000..909c38d4 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-output.json @@ -0,0 +1,1059 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ], + "range": [ + 8, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ], + "selfClosing": false, + "range": [ + 0, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "body": [ + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "AssignmentPattern", + "left": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "42", + "value": 42, + "range": [ + 51, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 34 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 41, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "optional": false, + "range": [ + 41, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "range": [ + 26, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "range": [ + 26, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 35 + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeLiteral", + "members": [ + { + "type": "TSPropertySignature", + "computed": false, + "key": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 60, + 72 + ], + "loc": { + "start": { + "line": 2, + "column": 41 + }, + "end": { + "line": 2, + "column": 53 + } + } + }, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSNumberKeyword", + "range": [ + 74, + 80 + ], + "loc": { + "start": { + "line": 2, + "column": 55 + }, + "end": { + "line": 2, + "column": 61 + } + } + }, + "range": [ + 72, + 80 + ], + "loc": { + "start": { + "line": 2, + "column": 53 + }, + "end": { + "line": 2, + "column": 61 + } + } + }, + "range": [ + 60, + 80 + ], + "loc": { + "start": { + "line": 2, + "column": 41 + }, + "end": { + "line": 2, + "column": 61 + } + } + } + ], + "range": [ + 58, + 82 + ], + "loc": { + "start": { + "line": 2, + "column": 39 + }, + "end": { + "line": 2, + "column": 63 + } + } + }, + "range": [ + 56, + 82 + ], + "loc": { + "start": { + "line": 2, + "column": 37 + }, + "end": { + "line": 2, + "column": 63 + } + } + }, + "range": [ + 24, + 82 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 63 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 85, + 91 + ], + "loc": { + "start": { + "line": 2, + "column": 66 + }, + "end": { + "line": 2, + "column": 72 + } + } + }, + "optional": false, + "range": [ + 85, + 93 + ], + "loc": { + "start": { + "line": 2, + "column": 66 + }, + "end": { + "line": 2, + "column": 74 + } + } + }, + "range": [ + 24, + 93 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 74 + } + } + } + ], + "range": [ + 20, + 94 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 75 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 95, + 104 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "range": [ + 0, + 104 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "HTMLText", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 16, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 20, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 24, + 25 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 39, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + } + }, + { + "type": "Identifier", + "value": "$bindable", + "range": [ + 41, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 50, + 51 + ], + "loc": { + "start": { + "line": 2, + "column": 31 + }, + "end": { + "line": 2, + "column": 32 + } + } + }, + { + "type": "Numeric", + "value": "42", + "range": [ + 51, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 53, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 34 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 55, + 56 + ], + "loc": { + "start": { + "line": 2, + "column": 36 + }, + "end": { + "line": 2, + "column": 37 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 56, + 57 + ], + "loc": { + "start": { + "line": 2, + "column": 37 + }, + "end": { + "line": 2, + "column": 38 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 58, + 59 + ], + "loc": { + "start": { + "line": 2, + "column": 39 + }, + "end": { + "line": 2, + "column": 40 + } + } + }, + { + "type": "Identifier", + "value": "bindableProp", + "range": [ + 60, + 72 + ], + "loc": { + "start": { + "line": 2, + "column": 41 + }, + "end": { + "line": 2, + "column": 53 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 72, + 73 + ], + "loc": { + "start": { + "line": 2, + "column": 53 + }, + "end": { + "line": 2, + "column": 54 + } + } + }, + { + "type": "Identifier", + "value": "number", + "range": [ + 74, + 80 + ], + "loc": { + "start": { + "line": 2, + "column": 55 + }, + "end": { + "line": 2, + "column": 61 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 81, + 82 + ], + "loc": { + "start": { + "line": 2, + "column": 62 + }, + "end": { + "line": 2, + "column": 63 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 83, + 84 + ], + "loc": { + "start": { + "line": 2, + "column": 64 + }, + "end": { + "line": 2, + "column": 65 + } + } + }, + { + "type": "Identifier", + "value": "$props", + "range": [ + 85, + 91 + ], + "loc": { + "start": { + "line": 2, + "column": 66 + }, + "end": { + "line": 2, + "column": 72 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 91, + 92 + ], + "loc": { + "start": { + "line": 2, + "column": 72 + }, + "end": { + "line": 2, + "column": 73 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 92, + 93 + ], + "loc": { + "start": { + "line": 2, + "column": 73 + }, + "end": { + "line": 2, + "column": 74 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 93, + 94 + ], + "loc": { + "start": { + "line": 2, + "column": 74 + }, + "end": { + "line": 2, + "column": 75 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 95, + 96 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 96, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 97, + 103 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 103, + 104 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + } + } + ], + "range": [ + 0, + 105 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 0 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-prefer-const-result.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-prefer-const-result.json new file mode 100644 index 00000000..ecab88c6 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-prefer-const-result.json @@ -0,0 +1,8 @@ +[ + { + "ruleId": "prefer-const", + "code": "bindableProp", + "line": 2, + "column": 8 + } +] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-scope-output.json new file mode 100644 index 00000000..a07dab4f --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-4-$bindable-ts-scope-output.json @@ -0,0 +1,731 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 85, + 91 + ], + "loc": { + "start": { + "line": 2, + "column": 66 + }, + "end": { + "line": 2, + "column": 72 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 41, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "bindableProp", + "identifiers": [ + { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "AssignmentPattern", + "left": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "42", + "value": 42, + "range": [ + 51, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 34 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 41, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "optional": false, + "range": [ + 41, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "range": [ + 26, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "range": [ + 26, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 35 + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeLiteral", + "members": [ + { + "type": "TSPropertySignature", + "computed": false, + "key": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 60, + 72 + ], + "loc": { + "start": { + "line": 2, + "column": 41 + }, + "end": { + "line": 2, + "column": 53 + } + } + }, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSNumberKeyword", + "range": [ + 74, + 80 + ], + "loc": { + "start": { + "line": 2, + "column": 55 + }, + "end": { + "line": 2, + "column": 61 + } + } + }, + "range": [ + 72, + 80 + ], + "loc": { + "start": { + "line": 2, + "column": 53 + }, + "end": { + "line": 2, + "column": 61 + } + } + }, + "range": [ + 60, + 80 + ], + "loc": { + "start": { + "line": 2, + "column": 41 + }, + "end": { + "line": 2, + "column": 61 + } + } + } + ], + "range": [ + 58, + 82 + ], + "loc": { + "start": { + "line": 2, + "column": 39 + }, + "end": { + "line": 2, + "column": 63 + } + } + }, + "range": [ + 56, + 82 + ], + "loc": { + "start": { + "line": 2, + "column": 37 + }, + "end": { + "line": 2, + "column": 63 + } + } + }, + "range": [ + 24, + 82 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 63 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 85, + 91 + ], + "loc": { + "start": { + "line": 2, + "column": 66 + }, + "end": { + "line": 2, + "column": 72 + } + } + }, + "optional": false, + "range": [ + 85, + 93 + ], + "loc": { + "start": { + "line": 2, + "column": 66 + }, + "end": { + "line": 2, + "column": 74 + } + } + }, + "range": [ + 24, + 93 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 74 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "bindableProp", + "range": [ + 26, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 41, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 85, + 91 + ], + "loc": { + "start": { + "line": 2, + "column": 66 + }, + "end": { + "line": 2, + "column": 72 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$bindable", + "range": [ + 41, + 50 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 85, + 91 + ], + "loc": { + "start": { + "line": 2, + "column": 66 + }, + "end": { + "line": 2, + "column": 72 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/09-how-to-opt-in-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/09-how-to-opt-in-scope-output.json index 2c234aed..970e1fce 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/09-how-to-opt-in-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/09-how-to-opt-in-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/10-$effect-root-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/10-$effect-root-scope-output.json index 7db04369..e3dbd37c 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/10-$effect-root-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/10-$effect-root-scope-output.json @@ -114,6 +114,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/11-1-$inspect-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/11-1-$inspect-scope-output.json index 0410ba54..daadb792 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/11-1-$inspect-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/11-1-$inspect-scope-output.json @@ -90,6 +90,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/11-1-$inspect-ts-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/11-1-$inspect-ts-scope-output.json index 6dbde91f..6ccb02bb 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/11-1-$inspect-ts-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/11-1-$inspect-ts-scope-output.json @@ -90,6 +90,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/11-2-$inspect-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/11-2-$inspect-scope-output.json index 12416a90..5b47930a 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/11-2-$inspect-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/11-2-$inspect-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/11-2-$inspect-ts-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/11-2-$inspect-ts-scope-output.json index fe7b1e2e..28f956da 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/11-2-$inspect-ts-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/11-2-$inspect-ts-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/11-3-$inspect-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/11-3-$inspect-scope-output.json index 28fd9e9d..93ab807d 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/11-3-$inspect-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/11-3-$inspect-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/11-3-$inspect-ts-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/11-3-$inspect-ts-scope-output.json index 60129978..f7dc7cbe 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/11-3-$inspect-ts-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/11-3-$inspect-ts-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/12-$inspect-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/12-$inspect-scope-output.json index 64442320..fb98f24c 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/12-$inspect-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/12-$inspect-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/13-$inspect-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/13-$inspect-scope-output.json index 72b26464..805d424c 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/13-$inspect-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/13-$inspect-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/01-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/01-scope-output.json index 5b9b60d4..50dbd80d 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/01-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/02-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/02-scope-output.json index f556b88c..579cb5ae 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/02-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/02-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/03-snippet-scope-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/03-snippet-scope-scope-output.json index 17957314..307e63ec 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/03-snippet-scope-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/03-snippet-scope-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/04-snippet-scope-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/04-snippet-scope-scope-output.json index 6673fbaa..22240395 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/04-snippet-scope-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/04-snippet-scope-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/05-snippet-scope-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/05-snippet-scope-scope-output.json index 45556974..5dfb22f6 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/05-snippet-scope-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/05-snippet-scope-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/06-passing-snippets-to-components-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/06-passing-snippets-to-components-scope-output.json index c4944ad1..27a14e34 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/06-passing-snippets-to-components-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/06-passing-snippets-to-components-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/07-passing-snippets-to-components-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/07-passing-snippets-to-components-scope-output.json index 6092b117..a5cbac2e 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/07-passing-snippets-to-components-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/07-passing-snippets-to-components-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/08-passing-snippets-to-components-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/08-passing-snippets-to-components-scope-output.json index c900dfd1..ac3a5490 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/08-passing-snippets-to-components-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/08-passing-snippets-to-components-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/09-passing-snippets-to-components-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/09-passing-snippets-to-components-scope-output.json index b4a23f04..90d333c7 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/09-passing-snippets-to-components-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/09-passing-snippets-to-components-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/10-typing-snippets-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/10-typing-snippets-scope-output.json index 35ac168e..c7026978 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/10-typing-snippets-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/10-typing-snippets-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/11-typing-snippets-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/snippets/11-typing-snippets-scope-output.json index ad3c4a3d..c602f4a9 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/snippets/11-typing-snippets-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/11-typing-snippets-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/01-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/01-scope-output.json index 398f8e5b..6bbe4108 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/01-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/02-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/02-scope-output.json index b7f11576..b2cc83b0 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/02-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/02-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/03-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/03-scope-output.json index f01fe863..8675e7db 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/03-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/03-scope-output.json @@ -49,6 +49,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/03-ts-scope-output.json b/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/03-ts-scope-output.json index f01fe863..8675e7db 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/03-ts-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/universal-reactivity/03-ts-scope-output.json @@ -49,6 +49,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/generics01-snippets-scope-output.json b/tests/fixtures/parser/ast/svelte5/generics01-snippets-scope-output.json index f77765a0..851915f2 100644 --- a/tests/fixtures/parser/ast/svelte5/generics01-snippets-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/generics01-snippets-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/render01-scope-output.json b/tests/fixtures/parser/ast/svelte5/render01-scope-output.json index c5adec2d..71189aaf 100644 --- a/tests/fixtures/parser/ast/svelte5/render01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/render01-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/render02-optional-scope-output.json b/tests/fixtures/parser/ast/svelte5/render02-optional-scope-output.json index e4cc516f..b35b3e02 100644 --- a/tests/fixtures/parser/ast/svelte5/render02-optional-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/render02-optional-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/snippet01-hoist-scope-output.json b/tests/fixtures/parser/ast/svelte5/snippet01-hoist-scope-output.json index b061912d..bed2e06f 100644 --- a/tests/fixtures/parser/ast/svelte5/snippet01-hoist-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/snippet01-hoist-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/svelte-ts-$derived01-scope-output.json b/tests/fixtures/parser/ast/svelte5/svelte-ts-$derived01-scope-output.json index e60dddd3..52c8191f 100644 --- a/tests/fixtures/parser/ast/svelte5/svelte-ts-$derived01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/svelte-ts-$derived01-scope-output.json @@ -73,6 +73,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/svelte-ts-$effect01-scope-output.json b/tests/fixtures/parser/ast/svelte5/svelte-ts-$effect01-scope-output.json index 17cab6c0..ecea58e6 100644 --- a/tests/fixtures/parser/ast/svelte5/svelte-ts-$effect01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/svelte-ts-$effect01-scope-output.json @@ -97,6 +97,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/svelte-ts-$props01-scope-output.json b/tests/fixtures/parser/ast/svelte5/svelte-ts-$props01-scope-output.json index 023cd98c..402f4917 100644 --- a/tests/fixtures/parser/ast/svelte5/svelte-ts-$props01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/svelte-ts-$props01-scope-output.json @@ -49,6 +49,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-$derived-by01-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-$derived-by01-scope-output.json index 536e0848..b0a5aaec 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$derived-by01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$derived-by01-scope-output.json @@ -91,6 +91,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-$derived01-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-$derived01-scope-output.json index 53ac2c24..01740936 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$derived01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$derived01-scope-output.json @@ -91,6 +91,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-$effect01-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-$effect01-scope-output.json index fe38e7c5..cfdb17bc 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$effect01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$effect01-scope-output.json @@ -115,6 +115,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-$effectpre01-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-$effectpre01-scope-output.json index a44baec5..25f2ab37 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$effectpre01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$effectpre01-scope-output.json @@ -115,6 +115,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-$props01-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-$props01-scope-output.json index a387916d..c8b02fd9 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$props01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$props01-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-$state-flozen01-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-$state-flozen01-scope-output.json index 6398f48f..db6325ed 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$state-flozen01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$state-flozen01-scope-output.json @@ -90,6 +90,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-$state01-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-$state01-scope-output.json index d5c29fb3..de240e41 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$state01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$state01-scope-output.json @@ -90,6 +90,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-event01-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-event01-scope-output.json index d26b1e5f..4cef454c 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-event01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-event01-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-event02-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-event02-scope-output.json index 18b2f1ba..517f37b7 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-event02-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-event02-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-event03-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-event03-scope-output.json index 8f39c531..ac118605 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-event03-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-event03-scope-output.json @@ -67,6 +67,12 @@ } ] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-event04-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-event04-scope-output.json index 86f0853b..5e0173a6 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-event04-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-event04-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-event05-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-event05-scope-output.json index d2967c31..d885356d 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-event05-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-event05-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-event06-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-event06-scope-output.json index 93169ac8..ff10f037 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-event06-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-event06-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-event07-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-event07-scope-output.json index 68e636d6..c6101845 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-event07-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-event07-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-event08-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-event08-scope-output.json index 83e389b4..b5d5e558 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-event08-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-event08-scope-output.json @@ -67,6 +67,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-snippet01-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-snippet01-scope-output.json index 009c609d..c31e2244 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-snippet01-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-snippet01-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/svelte5/ts-snippet02-hoist-scope-output.json b/tests/fixtures/parser/ast/svelte5/ts-snippet02-hoist-scope-output.json index c65bbf43..af808178 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-snippet02-hoist-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-snippet02-hoist-scope-output.json @@ -43,6 +43,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/ts-$$props01-scope-output-svelte5.json b/tests/fixtures/parser/ast/ts-$$props01-scope-output-svelte5.json index 7b00936f..2a684a4b 100644 --- a/tests/fixtures/parser/ast/ts-$$props01-scope-output-svelte5.json +++ b/tests/fixtures/parser/ast/ts-$$props01-scope-output-svelte5.json @@ -90,6 +90,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/ts-$$slots01-scope-output-svelte5.json b/tests/fixtures/parser/ast/ts-$$slots01-scope-output-svelte5.json index 7ef7f0bf..657c2e22 100644 --- a/tests/fixtures/parser/ast/ts-$$slots01-scope-output-svelte5.json +++ b/tests/fixtures/parser/ast/ts-$$slots01-scope-output-svelte5.json @@ -66,6 +66,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/ts-$$slots02-no-slot-scope-output-svelte5.json b/tests/fixtures/parser/ast/ts-$$slots02-no-slot-scope-output-svelte5.json index 7ef7f0bf..657c2e22 100644 --- a/tests/fixtures/parser/ast/ts-$$slots02-no-slot-scope-output-svelte5.json +++ b/tests/fixtures/parser/ast/ts-$$slots02-no-slot-scope-output-svelte5.json @@ -66,6 +66,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/ts-$$slots03-named-scope-output-svelte5.json b/tests/fixtures/parser/ast/ts-$$slots03-named-scope-output-svelte5.json index 7ef7f0bf..657c2e22 100644 --- a/tests/fixtures/parser/ast/ts-$$slots03-named-scope-output-svelte5.json +++ b/tests/fixtures/parser/ast/ts-$$slots03-named-scope-output-svelte5.json @@ -66,6 +66,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/ts-$$slots04-named-scope-output-svelte5.json b/tests/fixtures/parser/ast/ts-$$slots04-named-scope-output-svelte5.json index 7ef7f0bf..657c2e22 100644 --- a/tests/fixtures/parser/ast/ts-$$slots04-named-scope-output-svelte5.json +++ b/tests/fixtures/parser/ast/ts-$$slots04-named-scope-output-svelte5.json @@ -66,6 +66,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/fixtures/parser/ast/tutorial/optional-slots03-scope-output-svelte5.json b/tests/fixtures/parser/ast/tutorial/optional-slots03-scope-output-svelte5.json index abd0baca..57c5d830 100644 --- a/tests/fixtures/parser/ast/tutorial/optional-slots03-scope-output-svelte5.json +++ b/tests/fixtures/parser/ast/tutorial/optional-slots03-scope-output-svelte5.json @@ -89,6 +89,12 @@ "defs": [], "references": [] }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$inspect", "identifiers": [], diff --git a/tests/src/parser/test-utils.ts b/tests/src/parser/test-utils.ts index 30787c37..f72c79d5 100644 --- a/tests/src/parser/test-utils.ts +++ b/tests/src/parser/test-utils.ts @@ -69,6 +69,12 @@ const SVELTE5_SCOPE_VARIABLES_BASE = [ defs: [], references: [], }, + { + name: "$bindable", + identifiers: [], + defs: [], + references: [], + }, { name: "$inspect", identifiers: [],