diff --git a/package.json b/package.json index 3d1a4eab..afdead46 100644 --- a/package.json +++ b/package.json @@ -63,8 +63,8 @@ }, "devDependencies": { "@changesets/changelog-github": "^0.5.0", - "@changesets/cli": "^2.27.1", - "@changesets/get-release-plan": "^4.0.0", + "@changesets/cli": "^2.27.5", + "@changesets/get-release-plan": "^4.0.2", "@ota-meshi/eslint-plugin": "^0.15.3", "@types/benchmark": "^2.1.5", "@types/chai": "^4.3.16", @@ -73,26 +73,26 @@ "@types/eslint-visitor-keys": "^3.3.0", "@types/estree": "^1.0.5", "@types/mocha": "^10.0.6", - "@types/node": "^20.12.11", + "@types/node": "^20.14.2", "@types/semver": "^7.5.8", - "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/eslint-plugin": "^7.12.0", "@typescript-eslint/parser": "~7.11.0", "@typescript-eslint/types": "~7.11.0", "benchmark": "^2.1.4", "chai": "^4.4.1", "env-cmd": "^10.1.0", - "esbuild": "^0.21.0", + "esbuild": "^0.21.4", "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.1.0", - "eslint-plugin-jsonc": "^2.15.1", - "eslint-plugin-n": "^17.5.1", + "eslint-plugin-jsonc": "^2.16.0", + "eslint-plugin-n": "^17.8.1", "eslint-plugin-node-dependencies": "^0.12.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-regexp": "^2.5.0", - "eslint-plugin-svelte": "^2.38.0", + "eslint-plugin-regexp": "^2.6.0", + "eslint-plugin-svelte": "^2.39.2", "eslint-plugin-yml": "^1.14.0", "estree-walker": "^3.0.3", "locate-character": "^3.0.0", @@ -102,13 +102,13 @@ "nyc": "^15.1.0", "prettier": "~3.2.5", "prettier-plugin-pkg": "^0.18.1", - "prettier-plugin-svelte": "^3.2.3", - "rimraf": "^5.0.5", - "semver": "^7.6.1", - "svelte": "^5.0.0-next.125", - "svelte2tsx": "^0.7.8", + "prettier-plugin-svelte": "^3.2.4", + "rimraf": "^5.0.7", + "semver": "^7.6.2", + "svelte": "^5.0.0-next.152", + "svelte2tsx": "^0.7.9", "typescript": "~5.4.5", - "typescript-eslint-parser-for-extra-files": "^0.6.0" + "typescript-eslint-parser-for-extra-files": "^0.7.0" }, "publishConfig": { "access": "public" diff --git a/tests/fixtures/parser/ast/svelte5/ts-event06-type-output.svelte b/tests/fixtures/parser/ast/svelte5/ts-event06-type-output.svelte index 30db5378..d81884dd 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-event06-type-output.svelte +++ b/tests/fixtures/parser/ast/svelte5/ts-event06-type-output.svelte @@ -1,8 +1,8 @@ -{ // Component: __sveltets_2_IsomorphicComponent<$$ComponentProps, { [evt: string]: CustomEvent; }, {}, Record, string>, e: { detail: number; } // e.detail is number e.detail; // e.detail: number }}" /> diff --git a/tests/fixtures/parser/ast/ts-event06-requirements.json b/tests/fixtures/parser/ast/ts-event06-requirements.json index b0d8202a..cec5a976 100644 --- a/tests/fixtures/parser/ast/ts-event06-requirements.json +++ b/tests/fixtures/parser/ast/ts-event06-requirements.json @@ -1,5 +1,8 @@ { "scope": { "@typescript-eslint/parser": ">=6.5.0" + }, + "parse": { + "svelte": "^5.0.0-0" } } \ No newline at end of file diff --git a/tests/fixtures/parser/ast/ts-event06-sveltev4-input.svelte b/tests/fixtures/parser/ast/ts-event06-sveltev4-input.svelte new file mode 100644 index 00000000..7d277874 --- /dev/null +++ b/tests/fixtures/parser/ast/ts-event06-sveltev4-input.svelte @@ -0,0 +1,8 @@ + + + diff --git a/tests/fixtures/parser/ast/ts-event06-sveltev4-no-unused-expressions-result.json b/tests/fixtures/parser/ast/ts-event06-sveltev4-no-unused-expressions-result.json new file mode 100644 index 00000000..0fe83e99 --- /dev/null +++ b/tests/fixtures/parser/ast/ts-event06-sveltev4-no-unused-expressions-result.json @@ -0,0 +1,8 @@ +[ + { + "ruleId": "no-unused-expressions", + "code": "e.detail;", + "line": 7, + "column": 5 + } +] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/ts-event06-sveltev4-output.json b/tests/fixtures/parser/ast/ts-event06-sveltev4-output.json new file mode 100644 index 00000000..ca339e8c --- /dev/null +++ b/tests/fixtures/parser/ast/ts-event06-sveltev4-output.json @@ -0,0 +1,1192 @@ +{ + "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": "ImportDeclaration", + "importKind": "value", + "source": { + "type": "Literal", + "raw": "'./ts-event03-input.svelte'", + "value": "./ts-event03-input.svelte", + "range": [ + 45, + 72 + ], + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 53 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Component", + "range": [ + 30, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + "range": [ + 30, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 20 + } + } + } + ], + "range": [ + 23, + 73 + ], + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 54 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 74, + 83 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "range": [ + 0, + 83 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 83, + 85 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "component", + "name": { + "type": "Identifier", + "name": "Component", + "range": [ + 86, + 95 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 10 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteDirective", + "kind": "EventHandler", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "foo", + "range": [ + 99, + 102 + ], + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 17 + } + } + }, + "modifiers": [], + "range": [ + 96, + 102 + ], + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 17 + } + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "e", + "range": [ + 140, + 141 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "detail", + "range": [ + 142, + 148 + ], + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + "range": [ + 140, + 148 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + "range": [ + 140, + 149 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 13 + } + } + } + ], + "range": [ + 108, + 151 + ], + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 8, + "column": 1 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "e", + "range": [ + 105, + 106 + ], + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + } + } + ], + "range": [ + 105, + 151 + ], + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 8, + "column": 1 + } + } + }, + "range": [ + 96, + 153 + ], + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 8, + "column": 3 + } + } + } + ], + "selfClosing": true, + "range": [ + 85, + 156 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + } + }, + "children": [], + "endTag": null, + "range": [ + 85, + 156 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + } + } + ], + "sourceType": "module", + "comments": [ + { + "type": "Line", + "value": " e.detail is number", + "range": [ + 114, + 135 + ], + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 25 + } + } + } + ], + "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": "import", + "range": [ + 23, + 29 + ], + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "Component", + "range": [ + 30, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 40, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + { + "type": "String", + "value": "'./ts-event03-input.svelte'", + "range": [ + 45, + 72 + ], + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 53 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 72, + 73 + ], + "loc": { + "start": { + "line": 2, + "column": 53 + }, + "end": { + "line": 2, + "column": 54 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 74, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 75, + 76 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 76, + 82 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 82, + 83 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 83, + 85 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 85, + 86 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + } + }, + { + "type": "Identifier", + "value": "Component", + "range": [ + 86, + 95 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 10 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "on", + "range": [ + 96, + 98 + ], + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 98, + 99 + ], + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "foo", + "range": [ + 99, + 102 + ], + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 102, + 103 + ], + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 103, + 104 + ], + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 19 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 104, + 105 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 20 + } + } + }, + { + "type": "Identifier", + "value": "e", + "range": [ + 105, + 106 + ], + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 106, + 108 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 23 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 108, + 109 + ], + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + } + }, + { + "type": "Identifier", + "value": "e", + "range": [ + 140, + 141 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 141, + 142 + ], + "loc": { + "start": { + "line": 7, + "column": 5 + }, + "end": { + "line": 7, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "detail", + "range": [ + 142, + 148 + ], + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 148, + 149 + ], + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 150, + 151 + ], + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 151, + 152 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 8, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 152, + 153 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 154, + 155 + ], + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 155, + 156 + ], + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 6 + } + } + } + ], + "range": [ + 0, + 157 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 0 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/ts-event06-sveltev4-requirements.json b/tests/fixtures/parser/ast/ts-event06-sveltev4-requirements.json new file mode 100644 index 00000000..5afeb7b2 --- /dev/null +++ b/tests/fixtures/parser/ast/ts-event06-sveltev4-requirements.json @@ -0,0 +1,8 @@ +{ + "scope": { + "@typescript-eslint/parser": ">=6.5.0" + }, + "parse": { + "svelte": "^3.0.0 || ^4.0.0" + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/ts-event06-sveltev4-scope-output.json b/tests/fixtures/parser/ast/ts-event06-sveltev4-scope-output.json new file mode 100644 index 00000000..6bf44ff7 --- /dev/null +++ b/tests/fixtures/parser/ast/ts-event06-sveltev4-scope-output.json @@ -0,0 +1,469 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "Component", + "identifiers": [ + { + "type": "Identifier", + "name": "Component", + "range": [ + 30, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 20 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "Component", + "range": [ + 30, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + "node": { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Component", + "range": [ + 30, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + "range": [ + 30, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 20 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Component", + "range": [ + 86, + 95 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 10 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Component", + "range": [ + 30, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 20 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Component", + "range": [ + 86, + 95 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 10 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Component", + "range": [ + 30, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 20 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "e", + "identifiers": [ + { + "type": "Identifier", + "name": "e", + "range": [ + 105, + 106 + ], + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "e", + "range": [ + 105, + 106 + ], + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "node": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "e", + "range": [ + 140, + 141 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "detail", + "range": [ + 142, + 148 + ], + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + "range": [ + 140, + 148 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + "range": [ + 140, + 149 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 13 + } + } + } + ], + "range": [ + 108, + 151 + ], + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 8, + "column": 1 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "e", + "range": [ + 105, + 106 + ], + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + } + } + ], + "range": [ + 105, + 151 + ], + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 8, + "column": 1 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "e", + "range": [ + 140, + 141 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "e", + "range": [ + 105, + 106 + ], + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "e", + "range": [ + 140, + 141 + ], + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "e", + "range": [ + 105, + 106 + ], + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + } + } + } + ], + "childScopes": [], + "through": [] + } + ], + "through": [] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/ts-event06-sveltev4-type-output.svelte b/tests/fixtures/parser/ast/ts-event06-sveltev4-type-output.svelte new file mode 100644 index 00000000..cff9fc85 --- /dev/null +++ b/tests/fixtures/parser/ast/ts-event06-sveltev4-type-output.svelte @@ -0,0 +1,8 @@ + + + diff --git a/tests/fixtures/parser/ast/ts-event06-type-output.svelte b/tests/fixtures/parser/ast/ts-event06-type-output.svelte index 5646e07e..feb5cd6d 100644 --- a/tests/fixtures/parser/ast/ts-event06-type-output.svelte +++ b/tests/fixtures/parser/ast/ts-event06-type-output.svelte @@ -1,8 +1,8 @@ -{ // Component: __sveltets_2_IsomorphicComponent<{}, { foo: CustomEvent; bar: CustomEvent; } & { [evt: string]: CustomEvent; }, {}, Record, string>, e: CustomEvent // e.detail is number e.detail; // e.detail: number }}" /> diff --git a/tests/fixtures/parser/ast/ts-let/ts-let01-requirements.json b/tests/fixtures/parser/ast/ts-let/ts-let01-requirements.json index e218e93c..0b98b0a6 100644 --- a/tests/fixtures/parser/ast/ts-let/ts-let01-requirements.json +++ b/tests/fixtures/parser/ast/ts-let/ts-let01-requirements.json @@ -4,5 +4,8 @@ }, "scope": { "@typescript-eslint/parser": ">=6.5.0" + }, + "parse": { + "svelte": "^5.0.0-0" } } \ No newline at end of file diff --git a/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-input.svelte b/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-input.svelte new file mode 100644 index 00000000..2795b041 --- /dev/null +++ b/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-input.svelte @@ -0,0 +1,34 @@ + + +
+ +
+ {item.title} +
+
+ +
+ {item.title} +
+ + {foo} + +
+
diff --git a/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-output.json b/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-output.json new file mode 100644 index 00000000..9ef12230 --- /dev/null +++ b/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-output.json @@ -0,0 +1,4951 @@ +{ + "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": "ImportDeclaration", + "importKind": "value", + "source": { + "type": "Literal", + "raw": "\"./lib/Component.svelte\"", + "value": "./lib/Component.svelte", + "range": [ + 57, + 81 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 62 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Component", + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + "local": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + } + ], + "range": [ + 21, + 82 + ], + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 63 + } + } + }, + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "init": { + "type": "ArrayExpression", + "elements": [ + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "title", + "range": [ + 126, + 131 + ], + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 11 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"Svelte.dev\"", + "value": "Svelte.dev", + "range": [ + 133, + 145 + ], + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 25 + } + } + }, + "range": [ + 126, + 145 + ], + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 25 + } + } + }, + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "link", + "range": [ + 153, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"https://svelte.dev\"", + "value": "https://svelte.dev", + "range": [ + 159, + 179 + ], + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 32 + } + } + }, + "range": [ + 153, + 179 + ], + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 32 + } + } + } + ], + "range": [ + 118, + 186 + ], + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "title", + "range": [ + 200, + 205 + ], + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 11 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"TypeScript ESLint\"", + "value": "TypeScript ESLint", + "range": [ + 207, + 226 + ], + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + "range": [ + 200, + 226 + ], + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "link", + "range": [ + 234, + 238 + ], + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 10 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"https://typescript-eslint.io\"", + "value": "https://typescript-eslint.io", + "range": [ + 240, + 270 + ], + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 42 + } + } + }, + "range": [ + 234, + 270 + ], + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 42 + } + } + } + ], + "range": [ + 192, + 277 + ], + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "title", + "range": [ + 291, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 11 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"TypeScript\"", + "value": "TypeScript", + "range": [ + 298, + 310 + ], + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 291, + 310 + ], + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "link", + "range": [ + 318, + 322 + ], + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 10 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"https://www.typescriptlang.org\"", + "value": "https://www.typescriptlang.org", + "range": [ + 324, + 356 + ], + "loc": { + "start": { + "line": 15, + "column": 12 + }, + "end": { + "line": 15, + "column": 44 + } + } + }, + "range": [ + 318, + 356 + ], + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 44 + } + } + } + ], + "range": [ + 283, + 363 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 16, + "column": 5 + } + } + } + ], + "range": [ + 112, + 368 + ], + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 17, + "column": 3 + } + } + }, + "range": [ + 92, + 368 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 17, + "column": 3 + } + } + } + ], + "range": [ + 86, + 369 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 17, + "column": 4 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 370, + 379 + ], + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "range": [ + 0, + 379 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 379, + 381 + ], + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 20, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "main", + "range": [ + 382, + 386 + ], + "loc": { + "start": { + "line": 20, + "column": 1 + }, + "end": { + "line": 20, + "column": 5 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 381, + 387 + ], + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 6 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 387, + 390 + ], + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + { + "type": "SvelteElement", + "kind": "component", + "name": { + "type": "Identifier", + "name": "Component", + "range": [ + 391, + 400 + ], + "loc": { + "start": { + "line": 21, + "column": 3 + }, + "end": { + "line": 21, + "column": 12 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteShorthandAttribute", + "key": { + "type": "Identifier", + "name": "items", + "range": [ + 402, + 407 + ], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 19 + } + } + }, + "value": { + "type": "Identifier", + "name": "items", + "range": [ + 402, + 407 + ], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 19 + } + } + }, + "range": [ + 401, + 408 + ], + "loc": { + "start": { + "line": 21, + "column": 13 + }, + "end": { + "line": 21, + "column": 20 + } + } + }, + { + "type": "SvelteDirective", + "kind": "Let", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "item", + "range": [ + 413, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 29 + } + } + }, + "modifiers": [], + "range": [ + 409, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 21, + "column": 29 + } + } + }, + "expression": { + "type": "Identifier", + "name": "item", + "range": [ + 413, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 29 + } + } + }, + "range": [ + 409, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 21, + "column": 29 + } + } + } + ], + "selfClosing": false, + "range": [ + 390, + 418 + ], + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 30 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 418, + 423 + ], + "loc": { + "start": { + "line": 21, + "column": 30 + }, + "end": { + "line": 22, + "column": 4 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "div", + "range": [ + 424, + 427 + ], + "loc": { + "start": { + "line": 22, + "column": 5 + }, + "end": { + "line": 22, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 423, + 428 + ], + "loc": { + "start": { + "line": 22, + "column": 4 + }, + "end": { + "line": 22, + "column": 9 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 428, + 435 + ], + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 23, + "column": 6 + } + } + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "item", + "range": [ + 436, + 440 + ], + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 11 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "title", + "range": [ + 441, + 446 + ], + "loc": { + "start": { + "line": 23, + "column": 12 + }, + "end": { + "line": 23, + "column": 17 + } + } + }, + "range": [ + 436, + 446 + ], + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 17 + } + } + }, + "range": [ + 435, + 447 + ], + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 18 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 447, + 452 + ], + "loc": { + "start": { + "line": 23, + "column": 18 + }, + "end": { + "line": 24, + "column": 4 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 452, + 458 + ], + "loc": { + "start": { + "line": 24, + "column": 4 + }, + "end": { + "line": 24, + "column": 10 + } + } + }, + "range": [ + 423, + 458 + ], + "loc": { + "start": { + "line": 22, + "column": 4 + }, + "end": { + "line": 24, + "column": 10 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 458, + 461 + ], + "loc": { + "start": { + "line": 24, + "column": 10 + }, + "end": { + "line": 25, + "column": 2 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 461, + 473 + ], + "loc": { + "start": { + "line": 25, + "column": 2 + }, + "end": { + "line": 25, + "column": 14 + } + } + }, + "range": [ + 390, + 473 + ], + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 25, + "column": 14 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 473, + 476 + ], + "loc": { + "start": { + "line": 25, + "column": 14 + }, + "end": { + "line": 26, + "column": 2 + } + } + }, + { + "type": "SvelteElement", + "kind": "component", + "name": { + "type": "Identifier", + "name": "Component", + "range": [ + 477, + 486 + ], + "loc": { + "start": { + "line": 26, + "column": 3 + }, + "end": { + "line": 26, + "column": 12 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteShorthandAttribute", + "key": { + "type": "Identifier", + "name": "items", + "range": [ + 488, + 493 + ], + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 19 + } + } + }, + "value": { + "type": "Identifier", + "name": "items", + "range": [ + 488, + 493 + ], + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 19 + } + } + }, + "range": [ + 487, + 494 + ], + "loc": { + "start": { + "line": 26, + "column": 13 + }, + "end": { + "line": 26, + "column": 20 + } + } + } + ], + "selfClosing": false, + "range": [ + 476, + 495 + ], + "loc": { + "start": { + "line": 26, + "column": 2 + }, + "end": { + "line": 26, + "column": 21 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 495, + 500 + ], + "loc": { + "start": { + "line": 26, + "column": 21 + }, + "end": { + "line": 27, + "column": 4 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "div", + "range": [ + 501, + 504 + ], + "loc": { + "start": { + "line": 27, + "column": 5 + }, + "end": { + "line": 27, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteDirective", + "kind": "Let", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "item", + "range": [ + 509, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 13 + }, + "end": { + "line": 27, + "column": 17 + } + } + }, + "modifiers": [], + "range": [ + 505, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 9 + }, + "end": { + "line": 27, + "column": 17 + } + } + }, + "expression": { + "type": "Identifier", + "name": "item", + "range": [ + 509, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 13 + }, + "end": { + "line": 27, + "column": 17 + } + } + }, + "range": [ + 505, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 9 + }, + "end": { + "line": 27, + "column": 17 + } + } + } + ], + "selfClosing": false, + "range": [ + 500, + 514 + ], + "loc": { + "start": { + "line": 27, + "column": 4 + }, + "end": { + "line": 27, + "column": 18 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 514, + 521 + ], + "loc": { + "start": { + "line": 27, + "column": 18 + }, + "end": { + "line": 28, + "column": 6 + } + } + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "item", + "range": [ + 522, + 526 + ], + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 11 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "title", + "range": [ + 527, + 532 + ], + "loc": { + "start": { + "line": 28, + "column": 12 + }, + "end": { + "line": 28, + "column": 17 + } + } + }, + "range": [ + 522, + 532 + ], + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 17 + } + } + }, + "range": [ + 521, + 533 + ], + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 28, + "column": 18 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 533, + 538 + ], + "loc": { + "start": { + "line": 28, + "column": 18 + }, + "end": { + "line": 29, + "column": 4 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 538, + 544 + ], + "loc": { + "start": { + "line": 29, + "column": 4 + }, + "end": { + "line": 29, + "column": 10 + } + } + }, + "range": [ + 500, + 544 + ], + "loc": { + "start": { + "line": 27, + "column": 4 + }, + "end": { + "line": 29, + "column": 10 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 544, + 549 + ], + "loc": { + "start": { + "line": 29, + "column": 10 + }, + "end": { + "line": 30, + "column": 4 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "span", + "range": [ + 550, + 554 + ], + "loc": { + "start": { + "line": 30, + "column": 5 + }, + "end": { + "line": 30, + "column": 9 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "slot", + "range": [ + 555, + 559 + ], + "loc": { + "start": { + "line": 30, + "column": 10 + }, + "end": { + "line": 30, + "column": 14 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "count", + "range": [ + 561, + 566 + ], + "loc": { + "start": { + "line": 30, + "column": 16 + }, + "end": { + "line": 30, + "column": 21 + } + } + } + ], + "range": [ + 555, + 567 + ], + "loc": { + "start": { + "line": 30, + "column": 10 + }, + "end": { + "line": 30, + "column": 22 + } + } + }, + { + "type": "SvelteDirective", + "kind": "Let", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "count", + "range": [ + 572, + 577 + ], + "loc": { + "start": { + "line": 30, + "column": 27 + }, + "end": { + "line": 30, + "column": 32 + } + } + }, + "modifiers": [], + "range": [ + 568, + 577 + ], + "loc": { + "start": { + "line": 30, + "column": 23 + }, + "end": { + "line": 30, + "column": 32 + } + } + }, + "expression": { + "type": "Identifier", + "name": "foo", + "range": [ + 579, + 582 + ], + "loc": { + "start": { + "line": 30, + "column": 34 + }, + "end": { + "line": 30, + "column": 37 + } + } + }, + "range": [ + 568, + 583 + ], + "loc": { + "start": { + "line": 30, + "column": 23 + }, + "end": { + "line": 30, + "column": 38 + } + } + } + ], + "selfClosing": false, + "range": [ + 549, + 584 + ], + "loc": { + "start": { + "line": 30, + "column": 4 + }, + "end": { + "line": 30, + "column": 39 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 584, + 591 + ], + "loc": { + "start": { + "line": 30, + "column": 39 + }, + "end": { + "line": 31, + "column": 6 + } + } + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "foo", + "range": [ + 592, + 595 + ], + "loc": { + "start": { + "line": 31, + "column": 7 + }, + "end": { + "line": 31, + "column": 10 + } + } + }, + "range": [ + 591, + 596 + ], + "loc": { + "start": { + "line": 31, + "column": 6 + }, + "end": { + "line": 31, + "column": 11 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 596, + 601 + ], + "loc": { + "start": { + "line": 31, + "column": 11 + }, + "end": { + "line": 32, + "column": 4 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 601, + 608 + ], + "loc": { + "start": { + "line": 32, + "column": 4 + }, + "end": { + "line": 32, + "column": 11 + } + } + }, + "range": [ + 549, + 608 + ], + "loc": { + "start": { + "line": 30, + "column": 4 + }, + "end": { + "line": 32, + "column": 11 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 608, + 611 + ], + "loc": { + "start": { + "line": 32, + "column": 11 + }, + "end": { + "line": 33, + "column": 2 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 611, + 623 + ], + "loc": { + "start": { + "line": 33, + "column": 2 + }, + "end": { + "line": 33, + "column": 14 + } + } + }, + "range": [ + 476, + 623 + ], + "loc": { + "start": { + "line": 26, + "column": 2 + }, + "end": { + "line": 33, + "column": 14 + } + } + }, + { + "type": "SvelteText", + "value": "\n", + "range": [ + 623, + 624 + ], + "loc": { + "start": { + "line": 33, + "column": 14 + }, + "end": { + "line": 34, + "column": 0 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 624, + 631 + ], + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 7 + } + } + }, + "range": [ + 381, + 631 + ], + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 34, + "column": 7 + } + } + } + ], + "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": "import", + "range": [ + 21, + 27 + ], + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "Component", + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 37, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "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": "ListItem", + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 50, + 51 + ], + "loc": { + "start": { + "line": 2, + "column": 31 + }, + "end": { + "line": 2, + "column": 32 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 52, + 56 + ], + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 37 + } + } + }, + { + "type": "String", + "value": "\"./lib/Component.svelte\"", + "range": [ + 57, + 81 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 62 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 81, + 82 + ], + "loc": { + "start": { + "line": 2, + "column": 62 + }, + "end": { + "line": 2, + "column": 63 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 86, + 91 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "items", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 97, + 98 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + { + "type": "Punctuator", + "value": "[", + "range": [ + 107, + 108 + ], + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "]", + "range": [ + 108, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 24 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 110, + 111 + ], + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": "[", + "range": [ + 112, + 113 + ], + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 118, + 119 + ], + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + } + }, + { + "type": "Identifier", + "value": "title", + "range": [ + 126, + 131 + ], + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 131, + 132 + ], + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + { + "type": "String", + "value": "\"Svelte.dev\"", + "range": [ + 133, + 145 + ], + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 145, + 146 + ], + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 26 + } + } + }, + { + "type": "Identifier", + "value": "link", + "range": [ + 153, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 157, + 158 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + { + "type": "String", + "value": "\"https://svelte.dev\"", + "range": [ + 159, + 179 + ], + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 179, + 180 + ], + "loc": { + "start": { + "line": 7, + "column": 32 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 185, + 186 + ], + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 186, + 187 + ], + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 192, + 193 + ], + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 5 + } + } + }, + { + "type": "Identifier", + "value": "title", + "range": [ + 200, + 205 + ], + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 205, + 206 + ], + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 12 + } + } + }, + { + "type": "String", + "value": "\"TypeScript ESLint\"", + "range": [ + 207, + 226 + ], + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 226, + 227 + ], + "loc": { + "start": { + "line": 10, + "column": 32 + }, + "end": { + "line": 10, + "column": 33 + } + } + }, + { + "type": "Identifier", + "value": "link", + "range": [ + 234, + 238 + ], + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 238, + 239 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 11 + } + } + }, + { + "type": "String", + "value": "\"https://typescript-eslint.io\"", + "range": [ + 240, + 270 + ], + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 42 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 270, + 271 + ], + "loc": { + "start": { + "line": 11, + "column": 42 + }, + "end": { + "line": 11, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 276, + 277 + ], + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 277, + 278 + ], + "loc": { + "start": { + "line": 12, + "column": 5 + }, + "end": { + "line": 12, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 283, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 5 + } + } + }, + { + "type": "Identifier", + "value": "title", + "range": [ + 291, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 296, + 297 + ], + "loc": { + "start": { + "line": 14, + "column": 11 + }, + "end": { + "line": 14, + "column": 12 + } + } + }, + { + "type": "String", + "value": "\"TypeScript\"", + "range": [ + 298, + 310 + ], + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 310, + 311 + ], + "loc": { + "start": { + "line": 14, + "column": 25 + }, + "end": { + "line": 14, + "column": 26 + } + } + }, + { + "type": "Identifier", + "value": "link", + "range": [ + 318, + 322 + ], + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 322, + 323 + ], + "loc": { + "start": { + "line": 15, + "column": 10 + }, + "end": { + "line": 15, + "column": 11 + } + } + }, + { + "type": "String", + "value": "\"https://www.typescriptlang.org\"", + "range": [ + 324, + 356 + ], + "loc": { + "start": { + "line": 15, + "column": 12 + }, + "end": { + "line": 15, + "column": 44 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 356, + 357 + ], + "loc": { + "start": { + "line": 15, + "column": 44 + }, + "end": { + "line": 15, + "column": 45 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 362, + 363 + ], + "loc": { + "start": { + "line": 16, + "column": 4 + }, + "end": { + "line": 16, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 363, + 364 + ], + "loc": { + "start": { + "line": 16, + "column": 5 + }, + "end": { + "line": 16, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": "]", + "range": [ + 367, + 368 + ], + "loc": { + "start": { + "line": 17, + "column": 2 + }, + "end": { + "line": 17, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 368, + 369 + ], + "loc": { + "start": { + "line": 17, + "column": 3 + }, + "end": { + "line": 17, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 370, + 371 + ], + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 371, + 372 + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 372, + 378 + ], + "loc": { + "start": { + "line": 18, + "column": 2 + }, + "end": { + "line": 18, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 378, + 379 + ], + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 379, + 381 + ], + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 20, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 381, + 382 + ], + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "main", + "range": [ + 382, + 386 + ], + "loc": { + "start": { + "line": 20, + "column": 1 + }, + "end": { + "line": 20, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 386, + 387 + ], + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 6 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 387, + 390 + ], + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 390, + 391 + ], + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 3 + } + } + }, + { + "type": "Identifier", + "value": "Component", + "range": [ + 391, + 400 + ], + "loc": { + "start": { + "line": 21, + "column": 3 + }, + "end": { + "line": 21, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 401, + 402 + ], + "loc": { + "start": { + "line": 21, + "column": 13 + }, + "end": { + "line": 21, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "items", + "range": [ + 402, + 407 + ], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 19 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 407, + 408 + ], + "loc": { + "start": { + "line": 21, + "column": 19 + }, + "end": { + "line": 21, + "column": 20 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "let", + "range": [ + 409, + 412 + ], + "loc": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 21, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 412, + 413 + ], + "loc": { + "start": { + "line": 21, + "column": 24 + }, + "end": { + "line": 21, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "item", + "range": [ + 413, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 417, + 418 + ], + "loc": { + "start": { + "line": 21, + "column": 29 + }, + "end": { + "line": 21, + "column": 30 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 418, + 423 + ], + "loc": { + "start": { + "line": 21, + "column": 30 + }, + "end": { + "line": 22, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 423, + 424 + ], + "loc": { + "start": { + "line": 22, + "column": 4 + }, + "end": { + "line": 22, + "column": 5 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "div", + "range": [ + 424, + 427 + ], + "loc": { + "start": { + "line": 22, + "column": 5 + }, + "end": { + "line": 22, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 427, + 428 + ], + "loc": { + "start": { + "line": 22, + "column": 8 + }, + "end": { + "line": 22, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 428, + 435 + ], + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 23, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 435, + 436 + ], + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "item", + "range": [ + 436, + 440 + ], + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 440, + 441 + ], + "loc": { + "start": { + "line": 23, + "column": 11 + }, + "end": { + "line": 23, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "title", + "range": [ + 441, + 446 + ], + "loc": { + "start": { + "line": 23, + "column": 12 + }, + "end": { + "line": 23, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 446, + 447 + ], + "loc": { + "start": { + "line": 23, + "column": 17 + }, + "end": { + "line": 23, + "column": 18 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 447, + 452 + ], + "loc": { + "start": { + "line": 23, + "column": 18 + }, + "end": { + "line": 24, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 452, + 453 + ], + "loc": { + "start": { + "line": 24, + "column": 4 + }, + "end": { + "line": 24, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 453, + 454 + ], + "loc": { + "start": { + "line": 24, + "column": 5 + }, + "end": { + "line": 24, + "column": 6 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "div", + "range": [ + 454, + 457 + ], + "loc": { + "start": { + "line": 24, + "column": 6 + }, + "end": { + "line": 24, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 457, + 458 + ], + "loc": { + "start": { + "line": 24, + "column": 9 + }, + "end": { + "line": 24, + "column": 10 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 458, + 461 + ], + "loc": { + "start": { + "line": 24, + "column": 10 + }, + "end": { + "line": 25, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 461, + 462 + ], + "loc": { + "start": { + "line": 25, + "column": 2 + }, + "end": { + "line": 25, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 462, + 463 + ], + "loc": { + "start": { + "line": 25, + "column": 3 + }, + "end": { + "line": 25, + "column": 4 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "Component", + "range": [ + 463, + 472 + ], + "loc": { + "start": { + "line": 25, + "column": 4 + }, + "end": { + "line": 25, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 472, + 473 + ], + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 25, + "column": 14 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 473, + 476 + ], + "loc": { + "start": { + "line": 25, + "column": 14 + }, + "end": { + "line": 26, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 476, + 477 + ], + "loc": { + "start": { + "line": 26, + "column": 2 + }, + "end": { + "line": 26, + "column": 3 + } + } + }, + { + "type": "Identifier", + "value": "Component", + "range": [ + 477, + 486 + ], + "loc": { + "start": { + "line": 26, + "column": 3 + }, + "end": { + "line": 26, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 487, + 488 + ], + "loc": { + "start": { + "line": 26, + "column": 13 + }, + "end": { + "line": 26, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "items", + "range": [ + 488, + 493 + ], + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 19 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 493, + 494 + ], + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 20 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 494, + 495 + ], + "loc": { + "start": { + "line": 26, + "column": 20 + }, + "end": { + "line": 26, + "column": 21 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 495, + 500 + ], + "loc": { + "start": { + "line": 26, + "column": 21 + }, + "end": { + "line": 27, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 500, + 501 + ], + "loc": { + "start": { + "line": 27, + "column": 4 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "div", + "range": [ + 501, + 504 + ], + "loc": { + "start": { + "line": 27, + "column": 5 + }, + "end": { + "line": 27, + "column": 8 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "let", + "range": [ + 505, + 508 + ], + "loc": { + "start": { + "line": 27, + "column": 9 + }, + "end": { + "line": 27, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 508, + 509 + ], + "loc": { + "start": { + "line": 27, + "column": 12 + }, + "end": { + "line": 27, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "item", + "range": [ + 509, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 13 + }, + "end": { + "line": 27, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 513, + 514 + ], + "loc": { + "start": { + "line": 27, + "column": 17 + }, + "end": { + "line": 27, + "column": 18 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 514, + 521 + ], + "loc": { + "start": { + "line": 27, + "column": 18 + }, + "end": { + "line": 28, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 521, + 522 + ], + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 28, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "item", + "range": [ + 522, + 526 + ], + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 526, + 527 + ], + "loc": { + "start": { + "line": 28, + "column": 11 + }, + "end": { + "line": 28, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "title", + "range": [ + 527, + 532 + ], + "loc": { + "start": { + "line": 28, + "column": 12 + }, + "end": { + "line": 28, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 532, + 533 + ], + "loc": { + "start": { + "line": 28, + "column": 17 + }, + "end": { + "line": 28, + "column": 18 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 533, + 538 + ], + "loc": { + "start": { + "line": 28, + "column": 18 + }, + "end": { + "line": 29, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 538, + 539 + ], + "loc": { + "start": { + "line": 29, + "column": 4 + }, + "end": { + "line": 29, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 539, + 540 + ], + "loc": { + "start": { + "line": 29, + "column": 5 + }, + "end": { + "line": 29, + "column": 6 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "div", + "range": [ + 540, + 543 + ], + "loc": { + "start": { + "line": 29, + "column": 6 + }, + "end": { + "line": 29, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 543, + 544 + ], + "loc": { + "start": { + "line": 29, + "column": 9 + }, + "end": { + "line": 29, + "column": 10 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 544, + 549 + ], + "loc": { + "start": { + "line": 29, + "column": 10 + }, + "end": { + "line": 30, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 549, + 550 + ], + "loc": { + "start": { + "line": 30, + "column": 4 + }, + "end": { + "line": 30, + "column": 5 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "span", + "range": [ + 550, + 554 + ], + "loc": { + "start": { + "line": 30, + "column": 5 + }, + "end": { + "line": 30, + "column": 9 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "slot", + "range": [ + 555, + 559 + ], + "loc": { + "start": { + "line": 30, + "column": 10 + }, + "end": { + "line": 30, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 559, + 560 + ], + "loc": { + "start": { + "line": 30, + "column": 14 + }, + "end": { + "line": 30, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 560, + 561 + ], + "loc": { + "start": { + "line": 30, + "column": 15 + }, + "end": { + "line": 30, + "column": 16 + } + } + }, + { + "type": "HTMLText", + "value": "count", + "range": [ + 561, + 566 + ], + "loc": { + "start": { + "line": 30, + "column": 16 + }, + "end": { + "line": 30, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 566, + 567 + ], + "loc": { + "start": { + "line": 30, + "column": 21 + }, + "end": { + "line": 30, + "column": 22 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "let", + "range": [ + 568, + 571 + ], + "loc": { + "start": { + "line": 30, + "column": 23 + }, + "end": { + "line": 30, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 571, + 572 + ], + "loc": { + "start": { + "line": 30, + "column": 26 + }, + "end": { + "line": 30, + "column": 27 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "count", + "range": [ + 572, + 577 + ], + "loc": { + "start": { + "line": 30, + "column": 27 + }, + "end": { + "line": 30, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 577, + 578 + ], + "loc": { + "start": { + "line": 30, + "column": 32 + }, + "end": { + "line": 30, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 578, + 579 + ], + "loc": { + "start": { + "line": 30, + "column": 33 + }, + "end": { + "line": 30, + "column": 34 + } + } + }, + { + "type": "Identifier", + "value": "foo", + "range": [ + 579, + 582 + ], + "loc": { + "start": { + "line": 30, + "column": 34 + }, + "end": { + "line": 30, + "column": 37 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 582, + 583 + ], + "loc": { + "start": { + "line": 30, + "column": 37 + }, + "end": { + "line": 30, + "column": 38 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 583, + 584 + ], + "loc": { + "start": { + "line": 30, + "column": 38 + }, + "end": { + "line": 30, + "column": 39 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 584, + 591 + ], + "loc": { + "start": { + "line": 30, + "column": 39 + }, + "end": { + "line": 31, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 591, + 592 + ], + "loc": { + "start": { + "line": 31, + "column": 6 + }, + "end": { + "line": 31, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "foo", + "range": [ + 592, + 595 + ], + "loc": { + "start": { + "line": 31, + "column": 7 + }, + "end": { + "line": 31, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 595, + 596 + ], + "loc": { + "start": { + "line": 31, + "column": 10 + }, + "end": { + "line": 31, + "column": 11 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 596, + 601 + ], + "loc": { + "start": { + "line": 31, + "column": 11 + }, + "end": { + "line": 32, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 601, + 602 + ], + "loc": { + "start": { + "line": 32, + "column": 4 + }, + "end": { + "line": 32, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 602, + 603 + ], + "loc": { + "start": { + "line": 32, + "column": 5 + }, + "end": { + "line": 32, + "column": 6 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "span", + "range": [ + 603, + 607 + ], + "loc": { + "start": { + "line": 32, + "column": 6 + }, + "end": { + "line": 32, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 607, + 608 + ], + "loc": { + "start": { + "line": 32, + "column": 10 + }, + "end": { + "line": 32, + "column": 11 + } + } + }, + { + "type": "HTMLText", + "value": "\n ", + "range": [ + 608, + 611 + ], + "loc": { + "start": { + "line": 32, + "column": 11 + }, + "end": { + "line": 33, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 611, + 612 + ], + "loc": { + "start": { + "line": 33, + "column": 2 + }, + "end": { + "line": 33, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 612, + 613 + ], + "loc": { + "start": { + "line": 33, + "column": 3 + }, + "end": { + "line": 33, + "column": 4 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "Component", + "range": [ + 613, + 622 + ], + "loc": { + "start": { + "line": 33, + "column": 4 + }, + "end": { + "line": 33, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 622, + 623 + ], + "loc": { + "start": { + "line": 33, + "column": 13 + }, + "end": { + "line": 33, + "column": 14 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 623, + 624 + ], + "loc": { + "start": { + "line": 33, + "column": 14 + }, + "end": { + "line": 34, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 624, + 625 + ], + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 625, + 626 + ], + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 34, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "main", + "range": [ + 626, + 630 + ], + "loc": { + "start": { + "line": 34, + "column": 2 + }, + "end": { + "line": 34, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 630, + 631 + ], + "loc": { + "start": { + "line": 34, + "column": 6 + }, + "end": { + "line": 34, + "column": 7 + } + } + } + ], + "range": [ + 0, + 632 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 35, + "column": 0 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-requirements.json b/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-requirements.json new file mode 100644 index 00000000..e0674521 --- /dev/null +++ b/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-requirements.json @@ -0,0 +1,11 @@ +{ + "test": { + "@typescript-eslint/parser": ">=5.0.0" + }, + "scope": { + "@typescript-eslint/parser": ">=6.5.0" + }, + "parse": { + "svelte": "^3.0.0 || ^4.0.0" + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-scope-output.json b/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-scope-output.json new file mode 100644 index 00000000..85cf239b --- /dev/null +++ b/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-scope-output.json @@ -0,0 +1,3439 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "Component", + "identifiers": [ + { + "type": "Identifier", + "name": "Component", + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "Component", + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + "node": { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Component", + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Component", + "range": [ + 391, + 400 + ], + "loc": { + "start": { + "line": 21, + "column": 3 + }, + "end": { + "line": 21, + "column": 12 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Component", + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "Component", + "range": [ + 477, + 486 + ], + "loc": { + "start": { + "line": 26, + "column": 3 + }, + "end": { + "line": 26, + "column": 12 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Component", + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + } + } + ] + }, + { + "name": "ListItem", + "identifiers": [ + { + "type": "Identifier", + "name": "ListItem", + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + "node": { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + "local": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + } + } + ] + }, + { + "name": "items", + "identifiers": [ + { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "init": { + "type": "ArrayExpression", + "elements": [ + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "title", + "range": [ + 126, + 131 + ], + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 11 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"Svelte.dev\"", + "value": "Svelte.dev", + "range": [ + 133, + 145 + ], + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 25 + } + } + }, + "range": [ + 126, + 145 + ], + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 25 + } + } + }, + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "link", + "range": [ + 153, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"https://svelte.dev\"", + "value": "https://svelte.dev", + "range": [ + 159, + 179 + ], + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 32 + } + } + }, + "range": [ + 153, + 179 + ], + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 32 + } + } + } + ], + "range": [ + 118, + 186 + ], + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "title", + "range": [ + 200, + 205 + ], + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 11 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"TypeScript ESLint\"", + "value": "TypeScript ESLint", + "range": [ + 207, + 226 + ], + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + "range": [ + 200, + 226 + ], + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "link", + "range": [ + 234, + 238 + ], + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 10 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"https://typescript-eslint.io\"", + "value": "https://typescript-eslint.io", + "range": [ + 240, + 270 + ], + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 42 + } + } + }, + "range": [ + 234, + 270 + ], + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 42 + } + } + } + ], + "range": [ + 192, + 277 + ], + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "title", + "range": [ + 291, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 11 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"TypeScript\"", + "value": "TypeScript", + "range": [ + 298, + 310 + ], + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 291, + 310 + ], + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "link", + "range": [ + 318, + 322 + ], + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 10 + } + } + }, + "method": false, + "shorthand": false, + "value": { + "type": "Literal", + "raw": "\"https://www.typescriptlang.org\"", + "value": "https://www.typescriptlang.org", + "range": [ + 324, + 356 + ], + "loc": { + "start": { + "line": 15, + "column": 12 + }, + "end": { + "line": 15, + "column": 44 + } + } + }, + "range": [ + 318, + 356 + ], + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 44 + } + } + } + ], + "range": [ + 283, + 363 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 16, + "column": 5 + } + } + } + ], + "range": [ + 112, + 368 + ], + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 17, + "column": 3 + } + } + }, + "range": [ + 92, + 368 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 17, + "column": 3 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "items", + "range": [ + 402, + 407 + ], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 19 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "items", + "range": [ + 488, + 493 + ], + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 19 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 41, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "Component", + "range": [ + 391, + 400 + ], + "loc": { + "start": { + "line": 21, + "column": 3 + }, + "end": { + "line": 21, + "column": 12 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Component", + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "items", + "range": [ + 488, + 493 + ], + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 19 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "Component", + "range": [ + 477, + 486 + ], + "loc": { + "start": { + "line": 26, + "column": 3 + }, + "end": { + "line": 26, + "column": 12 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Component", + "range": [ + 28, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "item", + "identifiers": [ + { + "type": "Identifier", + "name": "item", + "range": [ + 413, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 29 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "item", + "range": [ + 413, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 29 + } + } + }, + "node": { + "type": "SvelteElement", + "kind": "component", + "name": { + "type": "Identifier", + "name": "Component", + "range": [ + 391, + 400 + ], + "loc": { + "start": { + "line": 21, + "column": 3 + }, + "end": { + "line": 21, + "column": 12 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteShorthandAttribute", + "key": { + "type": "Identifier", + "name": "items", + "range": [ + 402, + 407 + ], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 19 + } + } + }, + "value": { + "type": "Identifier", + "name": "items", + "range": [ + 402, + 407 + ], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 19 + } + } + }, + "range": [ + 401, + 408 + ], + "loc": { + "start": { + "line": 21, + "column": 13 + }, + "end": { + "line": 21, + "column": 20 + } + } + }, + { + "type": "SvelteDirective", + "kind": "Let", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "item", + "range": [ + 413, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 29 + } + } + }, + "modifiers": [], + "range": [ + 409, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 21, + "column": 29 + } + } + }, + "expression": { + "type": "Identifier", + "name": "item", + "range": [ + 413, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 29 + } + } + }, + "range": [ + 409, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 21, + "column": 29 + } + } + } + ], + "selfClosing": false, + "range": [ + 390, + 418 + ], + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 30 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 418, + 423 + ], + "loc": { + "start": { + "line": 21, + "column": 30 + }, + "end": { + "line": 22, + "column": 4 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "div", + "range": [ + 424, + 427 + ], + "loc": { + "start": { + "line": 22, + "column": 5 + }, + "end": { + "line": 22, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 423, + 428 + ], + "loc": { + "start": { + "line": 22, + "column": 4 + }, + "end": { + "line": 22, + "column": 9 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 428, + 435 + ], + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 23, + "column": 6 + } + } + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "item", + "range": [ + 436, + 440 + ], + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 11 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "title", + "range": [ + 441, + 446 + ], + "loc": { + "start": { + "line": 23, + "column": 12 + }, + "end": { + "line": 23, + "column": 17 + } + } + }, + "range": [ + 436, + 446 + ], + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 17 + } + } + }, + "range": [ + 435, + 447 + ], + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 18 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 447, + 452 + ], + "loc": { + "start": { + "line": 23, + "column": 18 + }, + "end": { + "line": 24, + "column": 4 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 452, + 458 + ], + "loc": { + "start": { + "line": 24, + "column": 4 + }, + "end": { + "line": 24, + "column": 10 + } + } + }, + "range": [ + 423, + 458 + ], + "loc": { + "start": { + "line": 22, + "column": 4 + }, + "end": { + "line": 24, + "column": 10 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 458, + 461 + ], + "loc": { + "start": { + "line": 24, + "column": 10 + }, + "end": { + "line": 25, + "column": 2 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 461, + 473 + ], + "loc": { + "start": { + "line": 25, + "column": 2 + }, + "end": { + "line": 25, + "column": 14 + } + } + }, + "range": [ + 390, + 473 + ], + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 25, + "column": 14 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "item", + "range": [ + 436, + 440 + ], + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 11 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "item", + "range": [ + 413, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 29 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "items", + "range": [ + 402, + 407 + ], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 19 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "item", + "range": [ + 436, + 440 + ], + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 11 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "item", + "range": [ + 413, + 417 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 29 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "items", + "range": [ + 402, + 407 + ], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 19 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "items", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ListItem", + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + } + }, + "range": [ + 99, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 97, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 92, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + } + ] + }, + { + "type": "function", + "variables": [ + { + "name": "item", + "identifiers": [ + { + "type": "Identifier", + "name": "item", + "range": [ + 509, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 13 + }, + "end": { + "line": 27, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "item", + "range": [ + 509, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 13 + }, + "end": { + "line": 27, + "column": 17 + } + } + }, + "node": { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "div", + "range": [ + 501, + 504 + ], + "loc": { + "start": { + "line": 27, + "column": 5 + }, + "end": { + "line": 27, + "column": 8 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteDirective", + "kind": "Let", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "item", + "range": [ + 509, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 13 + }, + "end": { + "line": 27, + "column": 17 + } + } + }, + "modifiers": [], + "range": [ + 505, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 9 + }, + "end": { + "line": 27, + "column": 17 + } + } + }, + "expression": { + "type": "Identifier", + "name": "item", + "range": [ + 509, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 13 + }, + "end": { + "line": 27, + "column": 17 + } + } + }, + "range": [ + 505, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 9 + }, + "end": { + "line": 27, + "column": 17 + } + } + } + ], + "selfClosing": false, + "range": [ + 500, + 514 + ], + "loc": { + "start": { + "line": 27, + "column": 4 + }, + "end": { + "line": 27, + "column": 18 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 514, + 521 + ], + "loc": { + "start": { + "line": 27, + "column": 18 + }, + "end": { + "line": 28, + "column": 6 + } + } + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "item", + "range": [ + 522, + 526 + ], + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 11 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "title", + "range": [ + 527, + 532 + ], + "loc": { + "start": { + "line": 28, + "column": 12 + }, + "end": { + "line": 28, + "column": 17 + } + } + }, + "range": [ + 522, + 532 + ], + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 17 + } + } + }, + "range": [ + 521, + 533 + ], + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 28, + "column": 18 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 533, + 538 + ], + "loc": { + "start": { + "line": 28, + "column": 18 + }, + "end": { + "line": 29, + "column": 4 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 538, + 544 + ], + "loc": { + "start": { + "line": 29, + "column": 4 + }, + "end": { + "line": 29, + "column": 10 + } + } + }, + "range": [ + 500, + 544 + ], + "loc": { + "start": { + "line": 27, + "column": 4 + }, + "end": { + "line": 29, + "column": 10 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "item", + "range": [ + 522, + 526 + ], + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 11 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "item", + "range": [ + 509, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 13 + }, + "end": { + "line": 27, + "column": 17 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "item", + "range": [ + 522, + 526 + ], + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 11 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "item", + "range": [ + 509, + 513 + ], + "loc": { + "start": { + "line": 27, + "column": 13 + }, + "end": { + "line": 27, + "column": 17 + } + } + } + } + ], + "childScopes": [], + "through": [] + }, + { + "type": "function", + "variables": [ + { + "name": "foo", + "identifiers": [ + { + "type": "Identifier", + "name": "foo", + "range": [ + 579, + 582 + ], + "loc": { + "start": { + "line": 30, + "column": 34 + }, + "end": { + "line": 30, + "column": 37 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "foo", + "range": [ + 579, + 582 + ], + "loc": { + "start": { + "line": 30, + "column": 34 + }, + "end": { + "line": 30, + "column": 37 + } + } + }, + "node": { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "span", + "range": [ + 550, + 554 + ], + "loc": { + "start": { + "line": 30, + "column": 5 + }, + "end": { + "line": 30, + "column": 9 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "slot", + "range": [ + 555, + 559 + ], + "loc": { + "start": { + "line": 30, + "column": 10 + }, + "end": { + "line": 30, + "column": 14 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "count", + "range": [ + 561, + 566 + ], + "loc": { + "start": { + "line": 30, + "column": 16 + }, + "end": { + "line": 30, + "column": 21 + } + } + } + ], + "range": [ + 555, + 567 + ], + "loc": { + "start": { + "line": 30, + "column": 10 + }, + "end": { + "line": 30, + "column": 22 + } + } + }, + { + "type": "SvelteDirective", + "kind": "Let", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "count", + "range": [ + 572, + 577 + ], + "loc": { + "start": { + "line": 30, + "column": 27 + }, + "end": { + "line": 30, + "column": 32 + } + } + }, + "modifiers": [], + "range": [ + 568, + 577 + ], + "loc": { + "start": { + "line": 30, + "column": 23 + }, + "end": { + "line": 30, + "column": 32 + } + } + }, + "expression": { + "type": "Identifier", + "name": "foo", + "range": [ + 579, + 582 + ], + "loc": { + "start": { + "line": 30, + "column": 34 + }, + "end": { + "line": 30, + "column": 37 + } + } + }, + "range": [ + 568, + 583 + ], + "loc": { + "start": { + "line": 30, + "column": 23 + }, + "end": { + "line": 30, + "column": 38 + } + } + } + ], + "selfClosing": false, + "range": [ + 549, + 584 + ], + "loc": { + "start": { + "line": 30, + "column": 4 + }, + "end": { + "line": 30, + "column": 39 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 584, + 591 + ], + "loc": { + "start": { + "line": 30, + "column": 39 + }, + "end": { + "line": 31, + "column": 6 + } + } + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "foo", + "range": [ + 592, + 595 + ], + "loc": { + "start": { + "line": 31, + "column": 7 + }, + "end": { + "line": 31, + "column": 10 + } + } + }, + "range": [ + 591, + 596 + ], + "loc": { + "start": { + "line": 31, + "column": 6 + }, + "end": { + "line": 31, + "column": 11 + } + } + }, + { + "type": "SvelteText", + "value": "\n ", + "range": [ + 596, + 601 + ], + "loc": { + "start": { + "line": 31, + "column": 11 + }, + "end": { + "line": 32, + "column": 4 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 601, + 608 + ], + "loc": { + "start": { + "line": 32, + "column": 4 + }, + "end": { + "line": 32, + "column": 11 + } + } + }, + "range": [ + 549, + 608 + ], + "loc": { + "start": { + "line": 30, + "column": 4 + }, + "end": { + "line": 32, + "column": 11 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "foo", + "range": [ + 592, + 595 + ], + "loc": { + "start": { + "line": 31, + "column": 7 + }, + "end": { + "line": 31, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "foo", + "range": [ + 579, + 582 + ], + "loc": { + "start": { + "line": 30, + "column": 34 + }, + "end": { + "line": 30, + "column": 37 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "foo", + "range": [ + 592, + 595 + ], + "loc": { + "start": { + "line": 31, + "column": 7 + }, + "end": { + "line": 31, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "foo", + "range": [ + 579, + 582 + ], + "loc": { + "start": { + "line": 30, + "column": 34 + }, + "end": { + "line": 30, + "column": 37 + } + } + } + } + ], + "childScopes": [], + "through": [] + } + ], + "through": [] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-type-output.svelte b/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-type-output.svelte new file mode 100644 index 00000000..1c1d5b0e --- /dev/null +++ b/tests/fixtures/parser/ast/ts-let/ts-let01-sveltev4-type-output.svelte @@ -0,0 +1,34 @@ + + +
+ +
+ {item.title} +
+
+ +
+ {item.title} +
+ + {foo} + +
+
diff --git a/tests/fixtures/parser/ast/ts-let/ts-let01-type-output.svelte b/tests/fixtures/parser/ast/ts-let/ts-let01-type-output.svelte index 7d92eac8..b087fd0d 100644 --- a/tests/fixtures/parser/ast/ts-let/ts-let01-type-output.svelte +++ b/tests/fixtures/parser/ast/ts-let/ts-let01-type-output.svelte @@ -1,5 +1,5 @@
- +
{item.title}
- +
{item.title}