From 62b698660ae1192214f434c9a705de43aee7b3ed Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Tue, 15 Mar 2022 20:39:55 +0900 Subject: [PATCH 01/76] Add support for scope analysis of ` + + diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/.eslintrc.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/.eslintrc.json new file mode 100644 index 00000000..f21f62ca --- /dev/null +++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/.eslintrc.json @@ -0,0 +1,5 @@ +{ + "rules": { + "no-undef": "error" + } +} diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/invalid/with-defaults.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/invalid/with-defaults.vue new file mode 100644 index 00000000..7496058b --- /dev/null +++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/invalid/with-defaults.vue @@ -0,0 +1,13 @@ + diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/with-defaults.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/with-defaults.vue new file mode 100644 index 00000000..6e2bd254 --- /dev/null +++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/no-undef/valid/with-defaults.vue @@ -0,0 +1,11 @@ + diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/output.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/output.json new file mode 100644 index 00000000..1a7e639e --- /dev/null +++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/output.json @@ -0,0 +1,17 @@ +[ + { + "filePath": "/no-undef/invalid/with-defaults.vue", + "messages": [ + { + "ruleId": "no-undef", + "line": 8, + "message": "'withDefaults' is not defined." + }, + { + "ruleId": "no-undef", + "line": 8, + "message": "'defineProps' is not defined." + } + ] + } +] diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/package.json b/test/fixtures/integrations/script-setup-with-typescript-eslint/package.json new file mode 100644 index 00000000..c158dd6f --- /dev/null +++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/package.json @@ -0,0 +1,7 @@ +{ + "devDependencies": { + "eslint": "^8.8.0", + "@typescript-eslint/parser": "^5.10.2", + "@typescript-eslint/eslint-plugin": "^5.10.2" + } +} diff --git a/test/fixtures/integrations/script-setup/.eslintrc.json b/test/fixtures/integrations/script-setup/.eslintrc.json new file mode 100644 index 00000000..7815413c --- /dev/null +++ b/test/fixtures/integrations/script-setup/.eslintrc.json @@ -0,0 +1,11 @@ +{ + "root": true, + "parser": "../../../../src/index.ts", + "parserOptions": { + "ecmaVersion": 2022, + "sourceType": "module" + }, + "env": { + "browser": true + } +} diff --git a/test/fixtures/integrations/script-setup/.npmrc b/test/fixtures/integrations/script-setup/.npmrc new file mode 100644 index 00000000..c1ca392f --- /dev/null +++ b/test/fixtures/integrations/script-setup/.npmrc @@ -0,0 +1 @@ +package-lock = false diff --git a/test/fixtures/integrations/script-setup/no-undef/.eslintrc.json b/test/fixtures/integrations/script-setup/no-undef/.eslintrc.json new file mode 100644 index 00000000..f21f62ca --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-undef/.eslintrc.json @@ -0,0 +1,5 @@ +{ + "rules": { + "no-undef": "error" + } +} diff --git a/test/fixtures/integrations/script-setup/no-undef/invalid/define-expose.vue b/test/fixtures/integrations/script-setup/no-undef/invalid/define-expose.vue new file mode 100644 index 00000000..aa6d6193 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-undef/invalid/define-expose.vue @@ -0,0 +1,13 @@ + diff --git a/test/fixtures/integrations/script-setup/no-undef/invalid/define-props-and-emits.vue b/test/fixtures/integrations/script-setup/no-undef/invalid/define-props-and-emits.vue new file mode 100644 index 00000000..c94cc8dc --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-undef/invalid/define-props-and-emits.vue @@ -0,0 +1,9 @@ + diff --git a/test/fixtures/integrations/script-setup/no-undef/valid/define-expose.vue b/test/fixtures/integrations/script-setup/no-undef/valid/define-expose.vue new file mode 100644 index 00000000..9a34c335 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-undef/valid/define-expose.vue @@ -0,0 +1,11 @@ + diff --git a/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits-with-import.vue b/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits-with-import.vue new file mode 100644 index 00000000..526aa2a7 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits-with-import.vue @@ -0,0 +1,9 @@ + diff --git a/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits.vue b/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits.vue new file mode 100644 index 00000000..d436665f --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-undef/valid/define-props-and-emits.vue @@ -0,0 +1,8 @@ + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/.eslintrc.json b/test/fixtures/integrations/script-setup/no-unused-vars/.eslintrc.json new file mode 100644 index 00000000..da817b4c --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/.eslintrc.json @@ -0,0 +1,5 @@ +{ + "rules": { + "no-unused-vars": "error" + } +} diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/component-names.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/component-names.vue new file mode 100644 index 00000000..63792e58 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/component-names.vue @@ -0,0 +1,7 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/css-v-bind.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/css-v-bind.vue new file mode 100644 index 00000000..43f25387 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/css-v-bind.vue @@ -0,0 +1,12 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/invalid-scope.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/invalid-scope.vue new file mode 100644 index 00000000..2943f78c --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/invalid-scope.vue @@ -0,0 +1,9 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/sample.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/sample.vue new file mode 100644 index 00000000..92024d49 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/sample.vue @@ -0,0 +1,22 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/with-v-for.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/with-v-for.vue new file mode 100644 index 00000000..213f418b --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/with-v-for.vue @@ -0,0 +1,8 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/invalid/without-script-setup.vue b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/without-script-setup.vue new file mode 100644 index 00000000..bb67fbb1 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/invalid/without-script-setup.vue @@ -0,0 +1,7 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-is.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-is.vue new file mode 100644 index 00000000..a08343d2 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-is.vue @@ -0,0 +1,9 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names1.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names1.vue new file mode 100644 index 00000000..26196fd1 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names1.vue @@ -0,0 +1,11 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names2.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names2.vue new file mode 100644 index 00000000..a75da9e9 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/component-names2.vue @@ -0,0 +1,9 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/css-v-bind.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/css-v-bind.vue new file mode 100644 index 00000000..822b035c --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/css-v-bind.vue @@ -0,0 +1,11 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/directive.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/directive.vue new file mode 100644 index 00000000..bff5a052 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/directive.vue @@ -0,0 +1,7 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/kebab-case-component.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/kebab-case-component.vue new file mode 100644 index 00000000..b4d26cd4 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/kebab-case-component.vue @@ -0,0 +1,10 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/mustash.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/mustash.vue new file mode 100644 index 00000000..c7c27a17 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/mustash.vue @@ -0,0 +1,7 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/ns-component.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/ns-component.vue new file mode 100644 index 00000000..84fcdcac --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/ns-component.vue @@ -0,0 +1,9 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/ref.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/ref.vue new file mode 100644 index 00000000..b2a58120 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/ref.vue @@ -0,0 +1,8 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/sample.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/sample.vue new file mode 100644 index 00000000..7c5b2f53 --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/sample.vue @@ -0,0 +1,16 @@ + + + diff --git a/test/fixtures/integrations/script-setup/no-unused-vars/valid/top-level-await.vue b/test/fixtures/integrations/script-setup/no-unused-vars/valid/top-level-await.vue new file mode 100644 index 00000000..be6f803a --- /dev/null +++ b/test/fixtures/integrations/script-setup/no-unused-vars/valid/top-level-await.vue @@ -0,0 +1,7 @@ + + + diff --git a/test/fixtures/integrations/script-setup/output.json b/test/fixtures/integrations/script-setup/output.json new file mode 100644 index 00000000..c8c96350 --- /dev/null +++ b/test/fixtures/integrations/script-setup/output.json @@ -0,0 +1,92 @@ +[ + { + "filePath": "/no-undef/invalid/define-expose.vue", + "messages": [ + { + "ruleId": "no-undef", + "line": 8, + "message": "'defineExpose' is not defined." + } + ] + }, + { + "filePath": "/no-undef/invalid/define-props-and-emits.vue", + "messages": [ + { + "ruleId": "no-undef", + "line": 3, + "message": "'defineProps' is not defined." + }, + { + "ruleId": "no-undef", + "line": 7, + "message": "'defineEmits' is not defined." + } + ] + }, + { + "filePath": "/no-unused-vars/invalid/component-names.vue", + "messages": [ + { + "ruleId": "no-unused-vars", + "line": 2, + "message": "'camelCase' is defined but never used." + } + ] + }, + { + "filePath": "/no-unused-vars/invalid/css-v-bind.vue", + "messages": [ + { + "ruleId": "no-unused-vars", + "line": 2, + "message": "'color' is assigned a value but never used." + } + ] + }, + { + "filePath": "/no-unused-vars/invalid/invalid-scope.vue", + "messages": [ + { + "ruleId": "no-unused-vars", + "line": 3, + "message": "'msg' is assigned a value but never used." + } + ] + }, + { + "filePath": "/no-unused-vars/invalid/sample.vue", + "messages": [ + { + "ruleId": "no-unused-vars", + "line": 4, + "message": "'Bar' is defined but never used." + }, + { + "ruleId": "no-unused-vars", + "line": 17, + "message": "'baz' is assigned a value but never used." + } + ] + }, + { + "filePath": "/no-unused-vars/invalid/with-v-for.vue", + "messages": [ + { + "ruleId": "no-unused-vars", + "line": 2, + "message": "'i' is assigned a value but never used." + } + ] + }, + { + "filePath": "/no-unused-vars/invalid/without-script-setup.vue", + "messages": [ + { + "ruleId": "no-unused-vars", + "line": 2, + "message": "'msg' is assigned a value but never used." + } + ] + } +] diff --git a/test/fixtures/integrations/script-setup/package.json b/test/fixtures/integrations/script-setup/package.json new file mode 100644 index 00000000..75604bef --- /dev/null +++ b/test/fixtures/integrations/script-setup/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "eslint": "^8.8.0" + } +} diff --git a/test/integrations.js b/test/integrations.js new file mode 100644 index 00000000..1f230e95 --- /dev/null +++ b/test/integrations.js @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert") +const path = require("path") +const fs = require("fs-extra") +const cp = require("child_process") +const semver = require("semver") +const eslintCompat = require("./lib/eslint-compat") + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const FIXTURE_DIR = path.join(__dirname, "fixtures/integrations") + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +describe("Integration tests", () => { + if (!semver.gte(process.version, "14.0.0")) { + return + } + for (const target of fs.readdirSync(FIXTURE_DIR)) { + it(target, async () => { + let ESLint = eslintCompat(require("eslint")).ESLint + if (fs.existsSync(path.join(FIXTURE_DIR, target, "package.json"))) { + const originalCwd = process.cwd() + try { + process.chdir(path.join(FIXTURE_DIR, target)) + cp.execSync("npm i", { stdio: "inherit" }) + ESLint = eslintCompat( + require(path.join( + FIXTURE_DIR, + target, + "node_modules/eslint", + )), + ).ESLint + } finally { + process.chdir(originalCwd) + } + } + const cwd = path.join(FIXTURE_DIR, target) + const cli = new ESLint({ + cwd, + }) + const report = await cli.lintFiles(["**/*.vue"]) + + const outputPath = path.join(FIXTURE_DIR, target, `output.json`) + const expected = JSON.parse(fs.readFileSync(outputPath, "utf8")) + try { + assert.deepStrictEqual( + normalizeReport(report, { withoutMessage: true }), + normalizeReport(expected, { + withoutMessage: true, + }), + ) + } catch (e) { + const actualPath = path.join( + FIXTURE_DIR, + target, + `_actual.json`, + ) + fs.writeFileSync( + actualPath, + JSON.stringify(normalizeReport(report), null, 4), + "utf8", + ) + throw e + } + + function normalizeReport(report, option = {}) { + return report + .filter((res) => res.messages.length) + .map((res) => { + return { + filePath: res.filePath + .replace(cwd, "") + .replace(/\\/gu, "/"), + messages: res.messages.map((msg) => { + return { + ruleId: msg.ruleId, + line: msg.line, + ...(option.withoutMessage + ? {} + : { message: msg.message }), + } + }), + } + }) + .sort((a, b) => + a.filePath < b.filePath + ? -1 + : a.filePath < b.filePath + ? 1 + : 0, + ) + } + }) + } +}) diff --git a/typings/eslint-scope/index.d.ts b/typings/eslint-scope/index.d.ts index 61228932..c3ae32b5 100644 --- a/typings/eslint-scope/index.d.ts +++ b/typings/eslint-scope/index.d.ts @@ -43,13 +43,13 @@ export interface Scope { variableScope: Scope } -export interface Variable { - defs: VariableDefinition[] - identifiers: estree.Identifier[] - name: string - references: Reference[] - scope: Scope - stack: boolean +export class Variable { + public defs: VariableDefinition[] + public identifiers: estree.Identifier[] + public name: string + public references: Reference[] + public scope: Scope + public stack: boolean } export interface VariableDefinition { @@ -59,20 +59,24 @@ export interface VariableDefinition { parent?: estree.Node } -export interface Reference { - from: Scope - identifier: estree.Identifier - partial: boolean - resolved: Variable | null - tainted: boolean - writeExpr: estree.Expression +export class Reference { + public from: Scope + public identifier: estree.Identifier + public partial: boolean + public resolved: Variable | null + public tainted: boolean + public writeExpr: estree.Expression + + public isRead(): boolean + public isReadOnly(): boolean + public isReadWrite(): boolean + public isStatic(): boolean + public isWrite(): boolean + public isWriteOnly(): boolean - isRead(): boolean - isReadOnly(): boolean - isReadWrite(): boolean - isStatic(): boolean - isWrite(): boolean - isWriteOnly(): boolean + // For typescript-eslint + public isTypeReference: boolean + public isValueReference: boolean } export declare const analyze: ( From 9448a785020d9635ab80eaa70b952206183d8638 Mon Sep 17 00:00:00 2001 From: rash Date: Thu, 14 Apr 2022 08:16:05 +0200 Subject: [PATCH 02/76] Custom template tokenizers (#148) * add support for custom template tokenizers * fix types * Make existing tests pass * merge tokens into existing tokenizer * add ast test * Write documentation for custom template tokenizers * forward tokenizer controls to custom tokenizer * document attributes used to control tokenizer * refactor template text tokenizing into separate method. * fix mock tokenizer token ranges * guard against empty text nodes * don't parse mustaches when template lang isn't html * test if tokenizer gets unprocessed mustaches * don't call the custom tokinzer on root text nodes if we are already processing a custom template lang * don't have empty tokens in custom tokenizer * add disclaimer for templateTokenizer option * prevent nested template parsing by checking if template is top level instead of maintaining a flag --- README.md | 23 + ...implementing-custom-template-tokenizers.md | 70 ++ src/common/parser-options.ts | 2 + src/html/parser.ts | 68 +- src/index.ts | 3 +- test/ast.js | 10 + .../ast/custom-template-tokenizer/ast.json | 884 ++++++++++++++++++ .../custom-tokenizer.js | 153 +++ .../parser-options.json | 5 + .../ast/custom-template-tokenizer/source.vue | 3 + .../token-ranges.json | 25 + .../ast/custom-template-tokenizer/tree.json | 107 +++ 12 files changed, 1350 insertions(+), 3 deletions(-) create mode 100644 docs/implementing-custom-template-tokenizers.md create mode 100644 test/fixtures/ast/custom-template-tokenizer/ast.json create mode 100644 test/fixtures/ast/custom-template-tokenizer/custom-tokenizer.js create mode 100644 test/fixtures/ast/custom-template-tokenizer/parser-options.json create mode 100644 test/fixtures/ast/custom-template-tokenizer/source.vue create mode 100644 test/fixtures/ast/custom-template-tokenizer/token-ranges.json create mode 100644 test/fixtures/ast/custom-template-tokenizer/tree.json diff --git a/README.md b/README.md index 62f128eb..9ad0f7e1 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,29 @@ If set to `true`, to parse expressions in `v-bind` CSS functions inside `` - const linter = new Linter() + const linter = new Linter({ configType: "flat" }) - linter.defineParser(PARSER_PATH, require(PARSER_PATH)) - linter.defineRule("test-no-forbidden", { - create(context) { - return context.parserServices.defineDocumentVisitor({ - 'Identifier[name="forbidden"]'(node) { - context.report({ - node, - message: 'no "forbidden"', - }) - }, - }) + const rules = { + "test-no-forbidden": { + create(context) { + return context.sourceCode.parserServices.defineDocumentVisitor( + { + 'Identifier[name="forbidden"]'(node) { + context.report({ + node, + message: 'no "forbidden"', + }) + }, + }, + ) + }, }, - }) - linter.defineRule("test-no-call", { - create(context) { - return context.parserServices.defineDocumentVisitor({ - CallExpression(node) { - context.report({ - node, - message: "no call", - }) - }, - }) + "test-no-call": { + create(context) { + return context.sourceCode.parserServices.defineDocumentVisitor( + { + CallExpression(node) { + context.report({ + node, + message: "no call", + }) + }, + }, + ) + }, }, - }) + } const messages = linter.verify(code, { - parser: PARSER_PATH, - parserOptions: { - ecmaVersion: 2018, + plugins: { + test: { + rules, + }, + }, + languageOptions: { + parser, }, rules: { - "test-no-forbidden": "error", - "test-no-call": "error", + "test/test-no-forbidden": "error", + "test/test-no-call": "error", }, }) assert.strictEqual(messages.length, 4) diff --git a/test/document-fragment.js b/test/document-fragment.js index b8f95f09..b824ca7c 100644 --- a/test/document-fragment.js +++ b/test/document-fragment.js @@ -17,7 +17,7 @@ const ROOT = path.join(__dirname, "fixtures/document-fragment") const TARGETS = fs.readdirSync(ROOT) const PARSER_OPTIONS = { comment: true, - ecmaVersion: 6, + ecmaVersion: "latest", loc: true, range: true, tokens: true, diff --git a/test/espree.js b/test/espree.js deleted file mode 100644 index 5b1d1cca..00000000 --- a/test/espree.js +++ /dev/null @@ -1,133 +0,0 @@ -"use strict" - -const path = require("path") - -/** - * Spawn a child process to run `childMain()`. - */ -function parentMain() { - const { spawn, execSync } = require("child_process") - - describe("Loading espree from ESLint", () => { - it("should load espree from the ESLint location.", (done) => { - spawn( - process.execPath, - ["--require", "ts-node/register", __filename, "--child1"], - { - stdio: "inherit", - }, - ) - .on("error", done) - .on("exit", (code) => - code - ? done(new Error(`Exited with non-zero: ${code}`)) - : done(), - ) - }) - it("should load espree from the ESLint location.", (done) => { - spawn( - process.execPath, - ["--require", "ts-node/register", __filename, "--child1"], - { - stdio: "inherit", - }, - ) - .on("error", done) - .on("exit", (code) => - code - ? done(new Error(`Exited with non-zero: ${code}`)) - : done(), - ) - }) - it("should load espree from the user location.", (done) => { - const originalCwd = process.cwd() - try { - process.chdir(path.join(__dirname, "./fixtures/espree-v8")) - execSync("npm i", { - stdio: "inherit", - }) - spawn( - process.execPath, - ["--require", "ts-node/register", __filename, "--child2"], - { - stdio: "inherit", - }, - ) - .on("error", done) - .on("exit", (code) => - code - ? done(new Error(`Exited with non-zero: ${code}`)) - : done(), - ) - } finally { - process.chdir(originalCwd) - } - }) - }) -} - -/** - * Check this parser loads the `espree` from the location of the loaded ESLint. - */ -function childMain1() { - const assert = require("assert") - const { Linter } = require("./fixtures/eslint") - const linter = new Linter() - linter.defineParser("vue-eslint-parser", require("../src")) - - const beforeEsprees = Object.keys(require.cache).filter(isEspreePath) - - linter.verify( - "", - { parser: "vue-eslint-parser" }, - { filename: "a.vue" }, - ) - - const afterEsprees = Object.keys(require.cache).filter(isEspreePath) - - assert.strictEqual( - afterEsprees.length, - beforeEsprees.length, - "espree should be loaded from the expected place", - ) -} - -/** - * Check this parser loads the `espree` from the location of the user dir. - */ -function childMain2() { - const assert = require("assert") - const { Linter } = require("./fixtures/eslint") - const linter = new Linter() - linter.defineParser("vue-eslint-parser", require("../src")) - - const result = linter.verify( - "", - { - parser: "vue-eslint-parser", - parserOptions: { - parser: "espree", - ecmaVersion: 2022, - sourceType: "module", - }, - }, - { filename: "a.vue" }, - ) - assert.strictEqual( - result.length, - 0, - "espree should be loaded from the fixtures/espree-v8", - ) -} - -function isEspreePath(p) { - return p.includes(`${path.sep}node_modules${path.sep}espree${path.sep}`) -} - -if (process.argv.includes("--child1")) { - childMain1() -} else if (process.argv.includes("--child2")) { - childMain2() -} else { - parentMain() -} diff --git a/test/fixtures/ast/address-component/ast.json b/test/fixtures/ast/address-component/ast.json index 7a2e1259..9aa8a9fb 100644 --- a/test/fixtures/ast/address-component/ast.json +++ b/test/fixtures/ast/address-component/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/attributes-linebreak/ast.json b/test/fixtures/ast/attributes-linebreak/ast.json index 5046b313..ed9be113 100644 --- a/test/fixtures/ast/attributes-linebreak/ast.json +++ b/test/fixtures/ast/attributes-linebreak/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/attributes/ast.json b/test/fixtures/ast/attributes/ast.json index 36033fe3..ff1b8f02 100644 --- a/test/fixtures/ast/attributes/ast.json +++ b/test/fixtures/ast/attributes/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/auto-closing-dt-dd/ast.json b/test/fixtures/ast/auto-closing-dt-dd/ast.json index 1b6ee98a..8f432dbc 100644 --- a/test/fixtures/ast/auto-closing-dt-dd/ast.json +++ b/test/fixtures/ast/auto-closing-dt-dd/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/auto-closing-p/ast.json b/test/fixtures/ast/auto-closing-p/ast.json index 6c02afe0..01d28fea 100644 --- a/test/fixtures/ast/auto-closing-p/ast.json +++ b/test/fixtures/ast/auto-closing-p/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/bogus-comments/ast.json b/test/fixtures/ast/bogus-comments/ast.json index df818408..78fd74f0 100644 --- a/test/fixtures/ast/bogus-comments/ast.json +++ b/test/fixtures/ast/bogus-comments/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/cdata/ast.json b/test/fixtures/ast/cdata/ast.json index 9e6cfa76..e2fb0d92 100644 --- a/test/fixtures/ast/cdata/ast.json +++ b/test/fixtures/ast/cdata/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/comments-2/ast.json b/test/fixtures/ast/comments-2/ast.json index e9039ec2..72d1aa98 100644 --- a/test/fixtures/ast/comments-2/ast.json +++ b/test/fixtures/ast/comments-2/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/comments-3/ast.json b/test/fixtures/ast/comments-3/ast.json index 5d4e705e..9af27f07 100644 --- a/test/fixtures/ast/comments-3/ast.json +++ b/test/fixtures/ast/comments-3/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/comments/ast.json b/test/fixtures/ast/comments/ast.json index 0c735c09..449c1d88 100644 --- a/test/fixtures/ast/comments/ast.json +++ b/test/fixtures/ast/comments/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/custom-template-tokenizer/ast.json b/test/fixtures/ast/custom-template-tokenizer/ast.json index d82bb8c4..bca7698c 100644 --- a/test/fixtures/ast/custom-template-tokenizer/ast.json +++ b/test/fixtures/ast/custom-template-tokenizer/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/custom-thead/ast.json b/test/fixtures/ast/custom-thead/ast.json index 52ec1866..3bed997e 100644 --- a/test/fixtures/ast/custom-thead/ast.json +++ b/test/fixtures/ast/custom-thead/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/define-model06-with-ts/ast.json b/test/fixtures/ast/define-model06-with-ts/ast.json index cde9a60a..3e647bdd 100644 --- a/test/fixtures/ast/define-model06-with-ts/ast.json +++ b/test/fixtures/ast/define-model06-with-ts/ast.json @@ -1,66 +1,61 @@ { "type": "Program", + "range": [ + 25, + 66 + ], "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "modelValue", + "optional": false, "range": [ 31, 41 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, "init": { "type": "CallExpression", + "arguments": [], "callee": { "type": "Identifier", + "decorators": [], "name": "defineModel", + "optional": false, "range": [ 44, 55 ], "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 30 + }, + "start": { + "line": 2, + "column": 19 } } }, - "arguments": [], "optional": false, - "range": [ - 44, - 65 - ], - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 40 - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 55, @@ -74,27 +69,41 @@ 62 ], "loc": { - "start": { - "line": 2, - "column": 31 - }, "end": { "line": 2, "column": 37 + }, + "start": { + "line": 2, + "column": 31 } } } ], "loc": { - "start": { - "line": 2, - "column": 30 - }, "end": { "line": 2, "column": 38 + }, + "start": { + "line": 2, + "column": 30 } } + }, + "range": [ + 44, + 65 + ], + "loc": { + "end": { + "line": 2, + "column": 40 + }, + "start": { + "line": 2, + "column": 19 + } } }, "range": [ @@ -102,49 +111,37 @@ 65 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 40 + }, + "start": { + "line": 2, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 25, 65 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 40 + }, + "start": { + "line": 2, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 25, - 66 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 3, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -166,165 +163,165 @@ }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 2, + "column": 5 + }, + "start": { + "line": 2, + "column": 0 + } + }, "range": [ 25, 30 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 0 + "column": 16 }, - "end": { + "start": { "line": 2, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "modelValue", + }, "range": [ 31, 41 ], + "value": "modelValue" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 6 + "column": 18 }, - "end": { + "start": { "line": 2, - "column": 16 + "column": 17 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 42, 43 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 17 + "column": 30 }, - "end": { + "start": { "line": 2, - "column": 18 + "column": 19 } - } - }, - { - "type": "Identifier", - "value": "defineModel", + }, "range": [ 44, 55 ], + "value": "defineModel" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 19 + "column": 31 }, - "end": { + "start": { "line": 2, "column": 30 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 55, 56 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 30 + "column": 37 }, - "end": { + "start": { "line": 2, "column": 31 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 56, 62 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 31 + "column": 38 }, - "end": { + "start": { "line": 2, "column": 37 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 62, 63 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 37 + "column": 39 }, - "end": { + "start": { "line": 2, "column": 38 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 63, 64 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 38 + "column": 40 }, - "end": { + "start": { "line": 2, "column": 39 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 64, 65 ], - "loc": { - "start": { - "line": 2, - "column": 39 - }, - "end": { - "line": 2, - "column": 40 - } - } + "value": ")" }, { "type": "Punctuator", @@ -345,7 +342,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 3, + "column": 0 + }, + "start": { + "line": 2, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -513,19 +519,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "modelValue", + "optional": false, "range": [ 106, 116 ], "loc": { - "start": { - "line": 6, - "column": 18 - }, "end": { "line": 6, "column": 28 + }, + "start": { + "line": 6, + "column": 18 } } }, @@ -533,19 +541,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "modelValue", + "optional": false, "range": [ 106, 116 ], "loc": { - "start": { - "line": 6, - "column": 18 - }, "end": { "line": 6, "column": 28 + }, + "start": { + "line": 6, + "column": 18 } } }, @@ -1052,21 +1062,21 @@ }, { "type": "Identifier", - "value": "modelValue", - "range": [ - 106, - 116 - ], "loc": { - "start": { - "line": 6, - "column": 18 - }, "end": { "line": 6, "column": 28 + }, + "start": { + "line": 6, + "column": 18 } - } + }, + "range": [ + 106, + 116 + ], + "value": "modelValue" }, { "type": "Punctuator", diff --git a/test/fixtures/ast/define-model06-with-ts/scope.json b/test/fixtures/ast/define-model06-with-ts/scope.json index ce177e84..d7c5edbe 100644 --- a/test/fixtures/ast/define-model06-with-ts/scope.json +++ b/test/fixtures/ast/define-model06-with-ts/scope.json @@ -2,13 +2,19 @@ "type": "global", "variables": [ { - "name": "ClassMemberDecoratorContext", + "name": "ClassAccessorDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "DecoratorContext", + "name": "ClassAccessorDecoratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorTarget", "identifiers": [], "defs": [], "references": [] @@ -20,7 +26,7 @@ "references": [] }, { - "name": "ClassMethodDecoratorContext", + "name": "ClassFieldDecoratorContext", "identifiers": [], "defs": [], "references": [] @@ -32,43 +38,43 @@ "references": [] }, { - "name": "ClassSetterDecoratorContext", + "name": "ClassMemberDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorContext", + "name": "ClassMethodDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorTarget", + "name": "ClassSetterDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorResult", + "name": "DecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassFieldDecoratorContext", + "name": "DecoratorMetadata", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassDecorator", + "name": "DecoratorMetadataObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDecorator", + "name": "ClassDecorator", "identifiers": [], "defs": [], "references": [] @@ -86,61 +92,73 @@ "references": [] }, { - "name": "Symbol", + "name": "PropertyDecorator", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyKey", + "name": "Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptor", + "name": "ArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptorMap", + "name": "ArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Object", + "name": "ArrayBufferLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "ObjectConstructor", + "name": "ArrayBufferTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Function", + "name": "ArrayBufferView", "identifiers": [], "defs": [], "references": [] }, { - "name": "FunctionConstructor", + "name": "ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisParameterType", + "name": "ArrayLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "OmitThisParameter", + "name": "Awaited", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Boolean", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BooleanConstructor", "identifiers": [], "defs": [], "references": [] @@ -152,7 +170,115 @@ "references": [] }, { - "name": "NewableFunction", + "name": "Capitalize", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ConcatArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ConstructorParameters", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DataView", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DataViewConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Date", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DateConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Error", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "EvalError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "EvalErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Exclude", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Extract", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float32Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Function", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FunctionConstructor", "identifiers": [], "defs": [], "references": [] @@ -164,25 +290,109 @@ "references": [] }, { - "name": "String", + "name": "ImportAssertions", "identifiers": [], "defs": [], "references": [] }, { - "name": "StringConstructor", + "name": "ImportAttributes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Boolean", + "name": "ImportCallOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "BooleanConstructor", + "name": "ImportMeta", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "InstanceType", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int8Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int8ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int16Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int16ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int32Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Intl", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "JSON", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Lowercase", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Math", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "NewableFunction", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "NoInfer", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "NonNullable", "identifiers": [], "defs": [], "references": [] @@ -200,679 +410,733 @@ "references": [] }, { - "name": "TemplateStringsArray", + "name": "Object", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportMeta", + "name": "ObjectConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportCallOptions", + "name": "Omit", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportAssertions", + "name": "OmitThisParameter", "identifiers": [], "defs": [], "references": [] }, { - "name": "Math", + "name": "Parameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "Date", + "name": "Partial", "identifiers": [], "defs": [], "references": [] }, { - "name": "DateConstructor", + "name": "Pick", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpMatchArray", + "name": "Promise", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpExecArray", + "name": "PromiseConstructorLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PropertyDescriptor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PropertyDescriptorMap", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PropertyKey", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RangeError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RangeErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Readonly", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ReadonlyArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Record", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExp", + "name": "ReferenceError", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpConstructor", + "name": "ReferenceErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Error", + "name": "RegExp", "identifiers": [], "defs": [], "references": [] }, { - "name": "ErrorConstructor", + "name": "RegExpConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalError", + "name": "RegExpExecArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalErrorConstructor", + "name": "RegExpMatchArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeError", + "name": "Required", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeErrorConstructor", + "name": "ReturnType", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceError", + "name": "String", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceErrorConstructor", + "name": "StringConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxError", + "name": "Symbol", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxErrorConstructor", + "name": "SyntaxError", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeError", + "name": "SyntaxErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeErrorConstructor", + "name": "TemplateStringsArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIError", + "name": "ThisParameterType", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIErrorConstructor", + "name": "ThisType", "identifiers": [], "defs": [], "references": [] }, { - "name": "JSON", + "name": "TypedPropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlyArray", + "name": "TypeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConcatArray", + "name": "TypeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Array", + "name": "Uint8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayConstructor", + "name": "Uint8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypedPropertyDescriptor", + "name": "Uint8ClampedArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructorLike", + "name": "Uint8ClampedArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseLike", + "name": "Uint16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Promise", + "name": "Uint16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Awaited", + "name": "Uint32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayLike", + "name": "Uint32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Partial", + "name": "Uncapitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "Required", + "name": "Uppercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "Readonly", + "name": "URIError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Pick", + "name": "URIErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Record", + "name": "WeakKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "Exclude", + "name": "WeakKeyTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Extract", + "name": "Map", "identifiers": [], "defs": [], "references": [] }, { - "name": "Omit", + "name": "MapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NonNullable", + "name": "ReadonlyMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Parameters", + "name": "ReadonlySet", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConstructorParameters", + "name": "Set", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReturnType", + "name": "SetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "InstanceType", + "name": "WeakMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uppercase", + "name": "WeakMapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Lowercase", + "name": "WeakSet", "identifiers": [], "defs": [], "references": [] }, { - "name": "Capitalize", + "name": "WeakSetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uncapitalize", + "name": "SymbolConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisType", + "name": "ArrayIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBuffer", + "name": "BuiltinIteratorReturn", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferTypes", + "name": "Iterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferLike", + "name": "IterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferConstructor", + "name": "Iterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferView", + "name": "IteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataView", + "name": "IteratorResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataViewConstructor", + "name": "IteratorReturnResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8Array", + "name": "IteratorYieldResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8ArrayConstructor", + "name": "MapIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8Array", + "name": "PromiseConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ArrayConstructor", + "name": "SetIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArray", + "name": "StringIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArrayConstructor", + "name": "Generator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16Array", + "name": "GeneratorFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16ArrayConstructor", + "name": "GeneratorFunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16Array", + "name": "ProxyConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16ArrayConstructor", + "name": "ProxyHandler", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32Array", + "name": "Reflect", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32ArrayConstructor", + "name": "Atomics", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32Array", + "name": "SharedArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32ArrayConstructor", + "name": "SharedArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32Array", + "name": "AsyncIterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32ArrayConstructor", + "name": "AsyncIterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64Array", + "name": "AsyncIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64ArrayConstructor", + "name": "AsyncIteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "Intl", + "name": "AsyncGenerator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Map", + "name": "AsyncGeneratorFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "MapConstructor", + "name": "AsyncGeneratorFunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlyMap", + "name": "FlatArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMap", + "name": "BigInt", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMapConstructor", + "name": "BigInt64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Set", + "name": "BigInt64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SetConstructor", + "name": "BigIntConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlySet", + "name": "BigIntToLocaleStringOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakSet", + "name": "BigUint64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakSetConstructor", + "name": "BigUint64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SymbolConstructor", + "name": "PromiseFulfilledResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorYieldResult", + "name": "PromiseRejectedResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorReturnResult", + "name": "PromiseSettledResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorResult", + "name": "RegExpStringIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterator", + "name": "AggregateError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterable", + "name": "AggregateErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IterableIterator", + "name": "FinalizationRegistry", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructor", + "name": "FinalizationRegistryConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Generator", + "name": "WeakRef", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunction", + "name": "WeakRefConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunctionConstructor", + "name": "ErrorOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyHandler", + "name": "RegExpIndicesArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyConstructor", + "name": "PromiseWithResolvers", "identifiers": [], "defs": [], "references": [] }, { - "name": "Reflect", + "name": "AsyncDisposable", "identifiers": [], "defs": [], "references": [] }, { - "name": "SharedArrayBuffer", + "name": "AsyncDisposableStack", "identifiers": [], "defs": [], "references": [] }, { - "name": "SharedArrayBufferConstructor", + "name": "AsyncDisposableStackConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Atomics", + "name": "Disposable", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterator", + "name": "DisposableStack", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterable", + "name": "DisposableStackConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterableIterator", + "name": "SuppressedError", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncGenerator", + "name": "SuppressedErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncGeneratorFunction", + "name": "ReadonlySetLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncGeneratorFunctionConstructor", + "name": "IteratorObjectConstructor", "identifiers": [], "defs": [], "references": [] @@ -893,13 +1157,13 @@ "type": "Identifier", "name": "defineModel", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 30 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -921,13 +1185,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } } @@ -938,13 +1202,13 @@ "node": { "type": "VariableDeclarator", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 40 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -957,13 +1221,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -972,13 +1236,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -989,13 +1253,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1004,13 +1268,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1026,13 +1290,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1041,13 +1305,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1058,13 +1322,13 @@ "type": "Identifier", "name": "defineModel", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 30 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -1079,13 +1343,13 @@ "type": "Identifier", "name": "defineModel", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 30 + }, + "start": { + "line": 2, + "column": 19 } } }, diff --git a/test/fixtures/ast/define-model07-with-ts/ast.json b/test/fixtures/ast/define-model07-with-ts/ast.json index 6c22d6dd..8ca432de 100644 --- a/test/fixtures/ast/define-model07-with-ts/ast.json +++ b/test/fixtures/ast/define-model07-with-ts/ast.json @@ -1,108 +1,100 @@ { "type": "Program", + "range": [ + 25, + 84 + ], "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "modelValue", + "optional": false, "range": [ 31, 41 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, "init": { "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "defineModel", - "range": [ - 44, - 55 - ], - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 30 - } - } - }, "arguments": [ { "type": "ObjectExpression", "properties": [ { "type": "Property", + "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "required", + "optional": false, "range": [ 66, 74 ], "loc": { - "start": { - "line": 2, - "column": 41 - }, "end": { "line": 2, "column": 49 + }, + "start": { + "line": 2, + "column": 41 } } }, + "kind": "init", + "method": false, + "optional": false, + "shorthand": false, "value": { "type": "Literal", - "value": true, "raw": "true", + "value": true, "range": [ 76, 80 ], "loc": { - "start": { - "line": 2, - "column": 51 - }, "end": { "line": 2, "column": 55 + }, + "start": { + "line": 2, + "column": 51 } } }, - "computed": false, - "method": false, - "shorthand": false, - "kind": "init", "range": [ 66, 80 ], "loc": { - "start": { - "line": 2, - "column": 41 - }, "end": { "line": 2, "column": 55 + }, + "start": { + "line": 2, + "column": 41 } } } @@ -112,33 +104,39 @@ 82 ], "loc": { - "start": { - "line": 2, - "column": 39 - }, "end": { "line": 2, "column": 57 + }, + "start": { + "line": 2, + "column": 39 } } } ], - "optional": false, - "range": [ - 44, - 83 - ], - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 58 + "callee": { + "type": "Identifier", + "decorators": [], + "name": "defineModel", + "optional": false, + "range": [ + 44, + 55 + ], + "loc": { + "end": { + "line": 2, + "column": 30 + }, + "start": { + "line": 2, + "column": 19 + } } }, - "typeParameters": { + "optional": false, + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 55, @@ -152,27 +150,41 @@ 62 ], "loc": { - "start": { - "line": 2, - "column": 31 - }, "end": { "line": 2, "column": 37 + }, + "start": { + "line": 2, + "column": 31 } } } ], "loc": { - "start": { - "line": 2, - "column": 30 - }, "end": { "line": 2, "column": 38 + }, + "start": { + "line": 2, + "column": 30 } } + }, + "range": [ + 44, + 83 + ], + "loc": { + "end": { + "line": 2, + "column": 58 + }, + "start": { + "line": 2, + "column": 19 + } } }, "range": [ @@ -180,49 +192,37 @@ 83 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 58 + }, + "start": { + "line": 2, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 25, 83 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 58 + }, + "start": { + "line": 2, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 25, - 84 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 3, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -244,255 +244,255 @@ }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 2, + "column": 5 + }, + "start": { + "line": 2, + "column": 0 + } + }, "range": [ 25, 30 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 0 + "column": 16 }, - "end": { + "start": { "line": 2, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "modelValue", + }, "range": [ 31, 41 ], + "value": "modelValue" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 6 + "column": 18 }, - "end": { + "start": { "line": 2, - "column": 16 + "column": 17 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 42, 43 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 17 + "column": 30 }, - "end": { + "start": { "line": 2, - "column": 18 + "column": 19 } - } - }, - { - "type": "Identifier", - "value": "defineModel", + }, "range": [ 44, 55 ], + "value": "defineModel" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 19 + "column": 31 }, - "end": { + "start": { "line": 2, "column": 30 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 55, 56 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 30 + "column": 37 }, - "end": { + "start": { "line": 2, "column": 31 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 56, 62 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 31 + "column": 38 }, - "end": { + "start": { "line": 2, "column": 37 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 62, 63 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 37 + "column": 39 }, - "end": { + "start": { "line": 2, "column": 38 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 63, 64 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 38 + "column": 40 }, - "end": { + "start": { "line": 2, "column": 39 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 64, 65 ], + "value": "{" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 39 + "column": 49 }, - "end": { + "start": { "line": 2, - "column": 40 + "column": 41 } - } - }, - { - "type": "Identifier", - "value": "required", + }, "range": [ 66, 74 ], + "value": "required" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 41 + "column": 50 }, - "end": { + "start": { "line": 2, "column": 49 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 74, 75 ], + "value": ":" + }, + { + "type": "Boolean", "loc": { - "start": { + "end": { "line": 2, - "column": 49 + "column": 55 }, - "end": { + "start": { "line": 2, - "column": 50 + "column": 51 } - } - }, - { - "type": "Boolean", - "value": "true", + }, "range": [ 76, 80 ], + "value": "true" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 51 + "column": 57 }, - "end": { + "start": { "line": 2, - "column": 55 + "column": 56 } - } - }, - { - "type": "Punctuator", - "value": "}", + }, "range": [ 81, 82 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 56 + "column": 58 }, - "end": { + "start": { "line": 2, "column": 57 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 82, 83 ], - "loc": { - "start": { - "line": 2, - "column": 57 - }, - "end": { - "line": 2, - "column": 58 - } - } + "value": ")" }, { "type": "Punctuator", @@ -513,7 +513,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 3, + "column": 0 + }, + "start": { + "line": 2, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -681,19 +690,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "modelValue", + "optional": false, "range": [ 124, 134 ], "loc": { - "start": { - "line": 6, - "column": 18 - }, "end": { "line": 6, "column": 28 + }, + "start": { + "line": 6, + "column": 18 } } }, @@ -701,19 +712,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "modelValue", + "optional": false, "range": [ 124, 134 ], "loc": { - "start": { - "line": 6, - "column": 18 - }, "end": { "line": 6, "column": 28 + }, + "start": { + "line": 6, + "column": 18 } } }, @@ -1328,21 +1341,21 @@ }, { "type": "Identifier", - "value": "modelValue", - "range": [ - 124, - 134 - ], "loc": { - "start": { - "line": 6, - "column": 18 - }, "end": { "line": 6, "column": 28 + }, + "start": { + "line": 6, + "column": 18 } - } + }, + "range": [ + 124, + 134 + ], + "value": "modelValue" }, { "type": "Punctuator", diff --git a/test/fixtures/ast/define-model07-with-ts/scope.json b/test/fixtures/ast/define-model07-with-ts/scope.json index d15f8bef..8c9171c8 100644 --- a/test/fixtures/ast/define-model07-with-ts/scope.json +++ b/test/fixtures/ast/define-model07-with-ts/scope.json @@ -2,13 +2,19 @@ "type": "global", "variables": [ { - "name": "ClassMemberDecoratorContext", + "name": "ClassAccessorDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "DecoratorContext", + "name": "ClassAccessorDecoratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorTarget", "identifiers": [], "defs": [], "references": [] @@ -20,7 +26,7 @@ "references": [] }, { - "name": "ClassMethodDecoratorContext", + "name": "ClassFieldDecoratorContext", "identifiers": [], "defs": [], "references": [] @@ -32,43 +38,43 @@ "references": [] }, { - "name": "ClassSetterDecoratorContext", + "name": "ClassMemberDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorContext", + "name": "ClassMethodDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorTarget", + "name": "ClassSetterDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorResult", + "name": "DecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassFieldDecoratorContext", + "name": "DecoratorMetadata", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassDecorator", + "name": "DecoratorMetadataObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDecorator", + "name": "ClassDecorator", "identifiers": [], "defs": [], "references": [] @@ -86,61 +92,73 @@ "references": [] }, { - "name": "Symbol", + "name": "PropertyDecorator", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyKey", + "name": "Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptor", + "name": "ArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptorMap", + "name": "ArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Object", + "name": "ArrayBufferLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "ObjectConstructor", + "name": "ArrayBufferTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Function", + "name": "ArrayBufferView", "identifiers": [], "defs": [], "references": [] }, { - "name": "FunctionConstructor", + "name": "ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisParameterType", + "name": "ArrayLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "OmitThisParameter", + "name": "Awaited", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Boolean", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BooleanConstructor", "identifiers": [], "defs": [], "references": [] @@ -152,7 +170,115 @@ "references": [] }, { - "name": "NewableFunction", + "name": "Capitalize", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ConcatArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ConstructorParameters", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DataView", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DataViewConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Date", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DateConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Error", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "EvalError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "EvalErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Exclude", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Extract", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float32Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Function", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FunctionConstructor", "identifiers": [], "defs": [], "references": [] @@ -164,25 +290,109 @@ "references": [] }, { - "name": "String", + "name": "ImportAssertions", "identifiers": [], "defs": [], "references": [] }, { - "name": "StringConstructor", + "name": "ImportAttributes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Boolean", + "name": "ImportCallOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "BooleanConstructor", + "name": "ImportMeta", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "InstanceType", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int8Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int8ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int16Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int16ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int32Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Intl", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "JSON", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Lowercase", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Math", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "NewableFunction", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "NoInfer", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "NonNullable", "identifiers": [], "defs": [], "references": [] @@ -200,679 +410,733 @@ "references": [] }, { - "name": "TemplateStringsArray", + "name": "Object", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportMeta", + "name": "ObjectConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportCallOptions", + "name": "Omit", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportAssertions", + "name": "OmitThisParameter", "identifiers": [], "defs": [], "references": [] }, { - "name": "Math", + "name": "Parameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "Date", + "name": "Partial", "identifiers": [], "defs": [], "references": [] }, { - "name": "DateConstructor", + "name": "Pick", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpMatchArray", + "name": "Promise", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpExecArray", + "name": "PromiseConstructorLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PropertyDescriptor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PropertyDescriptorMap", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PropertyKey", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RangeError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RangeErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Readonly", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ReadonlyArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Record", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExp", + "name": "ReferenceError", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpConstructor", + "name": "ReferenceErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Error", + "name": "RegExp", "identifiers": [], "defs": [], "references": [] }, { - "name": "ErrorConstructor", + "name": "RegExpConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalError", + "name": "RegExpExecArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalErrorConstructor", + "name": "RegExpMatchArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeError", + "name": "Required", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeErrorConstructor", + "name": "ReturnType", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceError", + "name": "String", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceErrorConstructor", + "name": "StringConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxError", + "name": "Symbol", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxErrorConstructor", + "name": "SyntaxError", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeError", + "name": "SyntaxErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeErrorConstructor", + "name": "TemplateStringsArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIError", + "name": "ThisParameterType", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIErrorConstructor", + "name": "ThisType", "identifiers": [], "defs": [], "references": [] }, { - "name": "JSON", + "name": "TypedPropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlyArray", + "name": "TypeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConcatArray", + "name": "TypeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Array", + "name": "Uint8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayConstructor", + "name": "Uint8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypedPropertyDescriptor", + "name": "Uint8ClampedArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructorLike", + "name": "Uint8ClampedArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseLike", + "name": "Uint16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Promise", + "name": "Uint16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Awaited", + "name": "Uint32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayLike", + "name": "Uint32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Partial", + "name": "Uncapitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "Required", + "name": "Uppercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "Readonly", + "name": "URIError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Pick", + "name": "URIErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Record", + "name": "WeakKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "Exclude", + "name": "WeakKeyTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Extract", + "name": "Map", "identifiers": [], "defs": [], "references": [] }, { - "name": "Omit", + "name": "MapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NonNullable", + "name": "ReadonlyMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Parameters", + "name": "ReadonlySet", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConstructorParameters", + "name": "Set", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReturnType", + "name": "SetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "InstanceType", + "name": "WeakMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uppercase", + "name": "WeakMapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Lowercase", + "name": "WeakSet", "identifiers": [], "defs": [], "references": [] }, { - "name": "Capitalize", + "name": "WeakSetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uncapitalize", + "name": "SymbolConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisType", + "name": "ArrayIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBuffer", + "name": "BuiltinIteratorReturn", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferTypes", + "name": "Iterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferLike", + "name": "IterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferConstructor", + "name": "Iterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferView", + "name": "IteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataView", + "name": "IteratorResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataViewConstructor", + "name": "IteratorReturnResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8Array", + "name": "IteratorYieldResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8ArrayConstructor", + "name": "MapIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8Array", + "name": "PromiseConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ArrayConstructor", + "name": "SetIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArray", + "name": "StringIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArrayConstructor", + "name": "Generator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16Array", + "name": "GeneratorFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16ArrayConstructor", + "name": "GeneratorFunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16Array", + "name": "ProxyConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16ArrayConstructor", + "name": "ProxyHandler", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32Array", + "name": "Reflect", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32ArrayConstructor", + "name": "Atomics", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32Array", + "name": "SharedArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32ArrayConstructor", + "name": "SharedArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32Array", + "name": "AsyncIterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32ArrayConstructor", + "name": "AsyncIterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64Array", + "name": "AsyncIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64ArrayConstructor", + "name": "AsyncIteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "Intl", + "name": "AsyncGenerator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Map", + "name": "AsyncGeneratorFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "MapConstructor", + "name": "AsyncGeneratorFunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlyMap", + "name": "FlatArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMap", + "name": "BigInt", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMapConstructor", + "name": "BigInt64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Set", + "name": "BigInt64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SetConstructor", + "name": "BigIntConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlySet", + "name": "BigIntToLocaleStringOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakSet", + "name": "BigUint64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakSetConstructor", + "name": "BigUint64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SymbolConstructor", + "name": "PromiseFulfilledResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorYieldResult", + "name": "PromiseRejectedResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorReturnResult", + "name": "PromiseSettledResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorResult", + "name": "RegExpStringIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterator", + "name": "AggregateError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterable", + "name": "AggregateErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IterableIterator", + "name": "FinalizationRegistry", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructor", + "name": "FinalizationRegistryConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Generator", + "name": "WeakRef", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunction", + "name": "WeakRefConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunctionConstructor", + "name": "ErrorOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyHandler", + "name": "RegExpIndicesArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyConstructor", + "name": "PromiseWithResolvers", "identifiers": [], "defs": [], "references": [] }, { - "name": "Reflect", + "name": "AsyncDisposable", "identifiers": [], "defs": [], "references": [] }, { - "name": "SharedArrayBuffer", + "name": "AsyncDisposableStack", "identifiers": [], "defs": [], "references": [] }, { - "name": "SharedArrayBufferConstructor", + "name": "AsyncDisposableStackConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Atomics", + "name": "Disposable", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterator", + "name": "DisposableStack", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterable", + "name": "DisposableStackConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterableIterator", + "name": "SuppressedError", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncGenerator", + "name": "SuppressedErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncGeneratorFunction", + "name": "ReadonlySetLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncGeneratorFunctionConstructor", + "name": "IteratorObjectConstructor", "identifiers": [], "defs": [], "references": [] @@ -893,13 +1157,13 @@ "type": "Identifier", "name": "defineModel", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 30 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -921,13 +1185,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } } @@ -938,13 +1202,13 @@ "node": { "type": "VariableDeclarator", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 58 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -957,13 +1221,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -972,13 +1236,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -989,13 +1253,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1004,13 +1268,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1026,13 +1290,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1041,13 +1305,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1058,13 +1322,13 @@ "type": "Identifier", "name": "defineModel", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 30 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -1079,13 +1343,13 @@ "type": "Identifier", "name": "defineModel", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 30 + }, + "start": { + "line": 2, + "column": 19 } } }, diff --git a/test/fixtures/ast/define-model08-with-ts-and-modifiers/ast.json b/test/fixtures/ast/define-model08-with-ts-and-modifiers/ast.json index b8d7ba48..ffde6fc7 100644 --- a/test/fixtures/ast/define-model08-with-ts-and-modifiers/ast.json +++ b/test/fixtures/ast/define-model08-with-ts-and-modifiers/ast.json @@ -1,176 +1,123 @@ { "type": "Program", + "range": [ + 25, + 198 + ], "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "ArrayPattern", + "decorators": [], "elements": [ { "type": "Identifier", + "decorators": [], "name": "modelValue", + "optional": false, "range": [ 32, 42 ], "loc": { - "start": { - "line": 2, - "column": 7 - }, "end": { "line": 2, "column": 17 + }, + "start": { + "line": 2, + "column": 7 } } }, { "type": "Identifier", + "decorators": [], "name": "modifiers", + "optional": false, "range": [ 44, 53 ], "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 28 + }, + "start": { + "line": 2, + "column": 19 } } } ], + "optional": false, "range": [ 31, 54 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 29 + }, + "start": { + "line": 2, + "column": 6 } } }, "init": { "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "defineModel", - "range": [ - 57, - 68 - ], - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 43 - } - } - }, "arguments": [ { "type": "ObjectExpression", "properties": [ { "type": "Property", + "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "set", + "optional": false, "range": [ 103, 106 ], "loc": { - "start": { - "line": 3, - "column": 2 - }, "end": { "line": 3, "column": 5 + }, + "start": { + "line": 3, + "column": 2 } } }, + "kind": "init", + "method": true, + "optional": false, + "shorthand": false, "value": { "type": "FunctionExpression", - "id": null, - "generator": false, - "expression": false, + "range": [ + 106, + 194 + ], "async": false, "body": { "type": "BlockStatement", "body": [ { "type": "IfStatement", - "test": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "modifiers", - "range": [ - 124, - 133 - ], - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 17 - } - } - }, - "property": { - "type": "Identifier", - "name": "trim", - "range": [ - 134, - 138 - ], - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 22 - } - } - }, - "computed": false, - "optional": false, - "range": [ - 124, - 138 - ], - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 22 - } - } - }, + "alternate": null, "consequent": { "type": "BlockStatement", "body": [ @@ -178,75 +125,79 @@ "type": "ReturnStatement", "argument": { "type": "CallExpression", + "arguments": [], "callee": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "value", + "optional": false, "range": [ 155, 160 ], "loc": { - "start": { - "line": 5, - "column": 13 - }, "end": { "line": 5, "column": 18 + }, + "start": { + "line": 5, + "column": 13 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "trim", + "optional": false, "range": [ 161, 165 ], "loc": { - "start": { - "line": 5, - "column": 19 - }, "end": { "line": 5, "column": 23 + }, + "start": { + "line": 5, + "column": 19 } } }, - "computed": false, - "optional": false, "range": [ 155, 165 ], "loc": { - "start": { - "line": 5, - "column": 13 - }, "end": { "line": 5, "column": 23 + }, + "start": { + "line": 5, + "column": 13 } } }, - "arguments": [], "optional": false, "range": [ 155, 167 ], "loc": { - "start": { - "line": 5, - "column": 13 - }, "end": { "line": 5, "column": 25 + }, + "start": { + "line": 5, + "column": 13 } } }, @@ -255,13 +206,13 @@ 167 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 25 + }, + "start": { + "line": 5, + "column": 6 } } } @@ -271,29 +222,87 @@ 173 ], "loc": { + "end": { + "line": 6, + "column": 5 + }, "start": { "line": 4, "column": 24 - }, + } + } + }, + "test": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "decorators": [], + "name": "modifiers", + "optional": false, + "range": [ + 124, + 133 + ], + "loc": { + "end": { + "line": 4, + "column": 17 + }, + "start": { + "line": 4, + "column": 8 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "decorators": [], + "name": "trim", + "optional": false, + "range": [ + 134, + 138 + ], + "loc": { + "end": { + "line": 4, + "column": 22 + }, + "start": { + "line": 4, + "column": 18 + } + } + }, + "range": [ + 124, + 138 + ], + "loc": { "end": { - "line": 6, - "column": 5 + "line": 4, + "column": 22 + }, + "start": { + "line": 4, + "column": 8 } } }, - "alternate": null, "range": [ 120, 173 ], "loc": { - "start": { - "line": 4, - "column": 4 - }, "end": { "line": 6, "column": 5 + }, + "start": { + "line": 4, + "column": 4 } } }, @@ -301,19 +310,21 @@ "type": "ReturnStatement", "argument": { "type": "Identifier", + "decorators": [], "name": "value", + "optional": false, "range": [ 185, 190 ], "loc": { - "start": { - "line": 7, - "column": 11 - }, "end": { "line": 7, "column": 16 + }, + "start": { + "line": 7, + "column": 11 } } }, @@ -322,13 +333,13 @@ 190 ], "loc": { - "start": { - "line": 7, - "column": 4 - }, "end": { "line": 7, "column": 16 + }, + "start": { + "line": 7, + "column": 4 } } } @@ -338,67 +349,65 @@ 194 ], "loc": { - "start": { - "line": 3, - "column": 13 - }, "end": { "line": 8, "column": 3 + }, + "start": { + "line": 3, + "column": 13 } } }, - "range": [ - 106, - 194 - ], + "declare": false, + "expression": false, + "generator": false, + "id": null, "params": [ { "type": "Identifier", + "decorators": [], "name": "value", + "optional": false, "range": [ 107, 112 ], "loc": { - "start": { - "line": 3, - "column": 6 - }, "end": { "line": 3, "column": 11 + }, + "start": { + "line": 3, + "column": 6 } } } ], "loc": { - "start": { - "line": 3, - "column": 5 - }, "end": { "line": 8, "column": 3 + }, + "start": { + "line": 3, + "column": 5 } } }, - "computed": false, - "method": true, - "shorthand": false, - "kind": "init", "range": [ 103, 194 ], "loc": { - "start": { - "line": 3, - "column": 2 - }, "end": { "line": 8, "column": 3 + }, + "start": { + "line": 3, + "column": 2 } } } @@ -408,33 +417,39 @@ 196 ], "loc": { - "start": { - "line": 2, - "column": 74 - }, "end": { "line": 9, "column": 1 + }, + "start": { + "line": 2, + "column": 74 } } } ], - "optional": false, - "range": [ - 57, - 197 - ], - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 9, - "column": 2 + "callee": { + "type": "Identifier", + "decorators": [], + "name": "defineModel", + "optional": false, + "range": [ + 57, + 68 + ], + "loc": { + "end": { + "line": 2, + "column": 43 + }, + "start": { + "line": 2, + "column": 32 + } } }, - "typeParameters": { + "optional": false, + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 68, @@ -448,13 +463,13 @@ 75 ], "loc": { - "start": { - "line": 2, - "column": 44 - }, "end": { "line": 2, "column": 50 + }, + "start": { + "line": 2, + "column": 44 } } }, @@ -465,20 +480,20 @@ "type": "TSLiteralType", "literal": { "type": "Literal", - "value": "trim", "raw": "'trim'", + "value": "trim", "range": [ 77, 83 ], "loc": { - "start": { - "line": 2, - "column": 52 - }, "end": { "line": 2, "column": 58 + }, + "start": { + "line": 2, + "column": 52 } } }, @@ -487,13 +502,13 @@ 83 ], "loc": { - "start": { - "line": 2, - "column": 52 - }, "end": { "line": 2, "column": 58 + }, + "start": { + "line": 2, + "column": 52 } } }, @@ -501,20 +516,20 @@ "type": "TSLiteralType", "literal": { "type": "Literal", - "value": "uppercase", "raw": "'uppercase'", + "value": "uppercase", "range": [ 86, 97 ], "loc": { - "start": { - "line": 2, - "column": 61 - }, "end": { "line": 2, "column": 72 + }, + "start": { + "line": 2, + "column": 61 } } }, @@ -523,13 +538,13 @@ 97 ], "loc": { - "start": { - "line": 2, - "column": 61 - }, "end": { "line": 2, "column": 72 + }, + "start": { + "line": 2, + "column": 61 } } } @@ -539,27 +554,41 @@ 97 ], "loc": { - "start": { - "line": 2, - "column": 52 - }, "end": { "line": 2, "column": 72 + }, + "start": { + "line": 2, + "column": 52 } } } ], "loc": { - "start": { - "line": 2, - "column": 43 - }, "end": { "line": 2, "column": 73 + }, + "start": { + "line": 2, + "column": 43 } } + }, + "range": [ + 57, + 197 + ], + "loc": { + "end": { + "line": 9, + "column": 2 + }, + "start": { + "line": 2, + "column": 32 + } } }, "range": [ @@ -567,49 +596,37 @@ 197 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 9, "column": 2 + }, + "start": { + "line": 2, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 25, 197 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 9, "column": 2 + }, + "start": { + "line": 2, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 25, - 198 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 10, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -631,741 +648,741 @@ }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 2, + "column": 5 + }, + "start": { + "line": 2, + "column": 0 + } + }, "range": [ 25, 30 ], + "value": "const" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 0 + "column": 7 }, - "end": { + "start": { "line": 2, - "column": 5 + "column": 6 } - } - }, - { - "type": "Punctuator", - "value": "[", + }, "range": [ 31, 32 ], + "value": "[" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 6 + "column": 17 }, - "end": { + "start": { "line": 2, "column": 7 } - } - }, - { - "type": "Identifier", - "value": "modelValue", + }, "range": [ 32, 42 ], + "value": "modelValue" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 7 + "column": 18 }, - "end": { + "start": { "line": 2, "column": 17 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 42, 43 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 17 + "column": 28 }, - "end": { + "start": { "line": 2, - "column": 18 + "column": 19 } - } - }, - { - "type": "Identifier", - "value": "modifiers", + }, "range": [ 44, 53 ], - "loc": { - "start": { + "value": "modifiers" + }, + { + "type": "Punctuator", + "loc": { + "end": { "line": 2, - "column": 19 + "column": 29 }, - "end": { + "start": { "line": 2, "column": 28 } - } - }, - { - "type": "Punctuator", - "value": "]", + }, "range": [ 53, 54 ], + "value": "]" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 28 + "column": 31 }, - "end": { + "start": { "line": 2, - "column": 29 + "column": 30 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 55, 56 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 30 + "column": 43 }, - "end": { + "start": { "line": 2, - "column": 31 + "column": 32 } - } - }, - { - "type": "Identifier", - "value": "defineModel", + }, "range": [ 57, 68 ], + "value": "defineModel" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 32 + "column": 44 }, - "end": { + "start": { "line": 2, "column": 43 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 68, 69 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 43 + "column": 50 }, - "end": { + "start": { "line": 2, "column": 44 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 69, 75 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 44 + "column": 51 }, - "end": { + "start": { "line": 2, "column": 50 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 75, 76 ], + "value": "," + }, + { + "type": "String", "loc": { - "start": { + "end": { "line": 2, - "column": 50 + "column": 58 }, - "end": { + "start": { "line": 2, - "column": 51 + "column": 52 } - } - }, - { - "type": "String", - "value": "'trim'", + }, "range": [ 77, 83 ], + "value": "'trim'" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 52 + "column": 60 }, - "end": { + "start": { "line": 2, - "column": 58 + "column": 59 } - } - }, - { - "type": "Punctuator", - "value": "|", + }, "range": [ 84, 85 ], + "value": "|" + }, + { + "type": "String", "loc": { - "start": { + "end": { "line": 2, - "column": 59 + "column": 72 }, - "end": { + "start": { "line": 2, - "column": 60 + "column": 61 } - } - }, - { - "type": "String", - "value": "'uppercase'", + }, "range": [ 86, 97 ], + "value": "'uppercase'" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 61 + "column": 73 }, - "end": { + "start": { "line": 2, "column": 72 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 97, 98 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 72 + "column": 74 }, - "end": { + "start": { "line": 2, "column": 73 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 98, 99 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 73 + "column": 75 }, - "end": { + "start": { "line": 2, "column": 74 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 99, 100 ], - "loc": { - "start": { - "line": 2, - "column": 74 - }, - "end": { - "line": 2, - "column": 75 - } - } + "value": "{" }, { "type": "Identifier", - "value": "set", + "loc": { + "end": { + "line": 3, + "column": 5 + }, + "start": { + "line": 3, + "column": 2 + } + }, "range": [ 103, 106 ], + "value": "set" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 2 + "column": 6 }, - "end": { + "start": { "line": 3, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 106, 107 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 5 + "column": 11 }, - "end": { + "start": { "line": 3, "column": 6 } - } - }, - { - "type": "Identifier", - "value": "value", + }, "range": [ 107, 112 ], + "value": "value" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 6 + "column": 12 }, - "end": { + "start": { "line": 3, "column": 11 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 112, 113 ], + "value": ")" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 11 + "column": 14 }, - "end": { + "start": { "line": 3, - "column": 12 + "column": 13 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 114, 115 ], - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 14 - } - } + "value": "{" }, { "type": "Keyword", - "value": "if", + "loc": { + "end": { + "line": 4, + "column": 6 + }, + "start": { + "line": 4, + "column": 4 + } + }, "range": [ 120, 122 ], + "value": "if" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 4, - "column": 4 + "column": 8 }, - "end": { + "start": { "line": 4, - "column": 6 + "column": 7 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 123, 124 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 7 + "column": 17 }, - "end": { + "start": { "line": 4, "column": 8 } - } - }, - { - "type": "Identifier", - "value": "modifiers", + }, "range": [ 124, 133 ], + "value": "modifiers" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 4, - "column": 8 + "column": 18 }, - "end": { + "start": { "line": 4, "column": 17 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 133, 134 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 17 + "column": 22 }, - "end": { + "start": { "line": 4, "column": 18 } - } - }, - { - "type": "Identifier", - "value": "trim", + }, "range": [ 134, 138 ], + "value": "trim" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 4, - "column": 18 + "column": 23 }, - "end": { + "start": { "line": 4, "column": 22 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 138, 139 ], - "loc": { - "start": { - "line": 4, - "column": 22 - }, - "end": { - "line": 4, - "column": 23 - } - } + "value": ")" }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 140, - 141 - ], - "loc": { - "start": { - "line": 4, - "column": 24 - }, + { + "type": "Punctuator", + "loc": { "end": { "line": 4, "column": 25 + }, + "start": { + "line": 4, + "column": 24 } - } + }, + "range": [ + 140, + 141 + ], + "value": "{" }, { "type": "Keyword", - "value": "return", + "loc": { + "end": { + "line": 5, + "column": 12 + }, + "start": { + "line": 5, + "column": 6 + } + }, "range": [ 148, 154 ], + "value": "return" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 6 + "column": 18 }, - "end": { + "start": { "line": 5, - "column": 12 + "column": 13 } - } - }, - { - "type": "Identifier", - "value": "value", + }, "range": [ 155, 160 ], + "value": "value" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 13 + "column": 19 }, - "end": { + "start": { "line": 5, "column": 18 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 160, 161 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 18 + "column": 23 }, - "end": { + "start": { "line": 5, "column": 19 } - } - }, - { - "type": "Identifier", - "value": "trim", + }, "range": [ 161, 165 ], + "value": "trim" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 19 + "column": 24 }, - "end": { + "start": { "line": 5, "column": 23 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 165, 166 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 23 + "column": 25 }, - "end": { + "start": { "line": 5, "column": 24 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 166, 167 ], - "loc": { - "start": { - "line": 5, - "column": 24 - }, - "end": { - "line": 5, - "column": 25 - } - } + "value": ")" }, { "type": "Punctuator", - "value": "}", - "range": [ - 172, - 173 - ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 5 + }, + "start": { + "line": 6, + "column": 4 } - } + }, + "range": [ + 172, + 173 + ], + "value": "}" }, { "type": "Keyword", - "value": "return", - "range": [ - 178, - 184 - ], "loc": { - "start": { - "line": 7, - "column": 4 - }, "end": { "line": 7, "column": 10 + }, + "start": { + "line": 7, + "column": 4 } - } + }, + "range": [ + 178, + 184 + ], + "value": "return" }, { "type": "Identifier", - "value": "value", - "range": [ - 185, - 190 - ], "loc": { - "start": { - "line": 7, - "column": 11 - }, "end": { "line": 7, "column": 16 + }, + "start": { + "line": 7, + "column": 11 } - } + }, + "range": [ + 185, + 190 + ], + "value": "value" }, { "type": "Punctuator", - "value": "}", - "range": [ - 193, - 194 - ], "loc": { - "start": { - "line": 8, - "column": 2 - }, "end": { "line": 8, "column": 3 + }, + "start": { + "line": 8, + "column": 2 } - } + }, + "range": [ + 193, + 194 + ], + "value": "}" }, { "type": "Punctuator", - "value": "}", + "loc": { + "end": { + "line": 9, + "column": 1 + }, + "start": { + "line": 9, + "column": 0 + } + }, "range": [ 195, 196 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 0 + "column": 2 }, - "end": { + "start": { "line": 9, "column": 1 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 196, 197 ], - "loc": { - "start": { - "line": 9, - "column": 1 - }, - "end": { - "line": 9, - "column": 2 - } - } + "value": ")" }, { "type": "Punctuator", @@ -1386,7 +1403,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 10, + "column": 0 + }, + "start": { + "line": 2, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -1554,19 +1580,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "modelValue", + "optional": false, "range": [ 238, 248 ], "loc": { - "start": { - "line": 13, - "column": 18 - }, "end": { "line": 13, "column": 28 + }, + "start": { + "line": 13, + "column": 18 } } }, @@ -1574,19 +1602,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "modelValue", + "optional": false, "range": [ 238, 248 ], "loc": { - "start": { - "line": 13, - "column": 18 - }, "end": { "line": 13, "column": 28 + }, + "start": { + "line": 13, + "column": 18 } } }, @@ -2669,21 +2699,21 @@ }, { "type": "Identifier", - "value": "modelValue", - "range": [ - 238, - 248 - ], "loc": { - "start": { - "line": 13, - "column": 18 - }, "end": { "line": 13, "column": 28 + }, + "start": { + "line": 13, + "column": 18 } - } + }, + "range": [ + 238, + 248 + ], + "value": "modelValue" }, { "type": "Punctuator", diff --git a/test/fixtures/ast/define-model08-with-ts-and-modifiers/scope.json b/test/fixtures/ast/define-model08-with-ts-and-modifiers/scope.json index 43e387c4..004c5a1b 100644 --- a/test/fixtures/ast/define-model08-with-ts-and-modifiers/scope.json +++ b/test/fixtures/ast/define-model08-with-ts-and-modifiers/scope.json @@ -2,13 +2,19 @@ "type": "global", "variables": [ { - "name": "ClassMemberDecoratorContext", + "name": "ClassAccessorDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "DecoratorContext", + "name": "ClassAccessorDecoratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorTarget", "identifiers": [], "defs": [], "references": [] @@ -20,7 +26,7 @@ "references": [] }, { - "name": "ClassMethodDecoratorContext", + "name": "ClassFieldDecoratorContext", "identifiers": [], "defs": [], "references": [] @@ -32,43 +38,43 @@ "references": [] }, { - "name": "ClassSetterDecoratorContext", + "name": "ClassMemberDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorContext", + "name": "ClassMethodDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorTarget", + "name": "ClassSetterDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorResult", + "name": "DecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassFieldDecoratorContext", + "name": "DecoratorMetadata", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassDecorator", + "name": "DecoratorMetadataObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDecorator", + "name": "ClassDecorator", "identifiers": [], "defs": [], "references": [] @@ -86,265 +92,271 @@ "references": [] }, { - "name": "Symbol", + "name": "PropertyDecorator", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyKey", + "name": "Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptor", + "name": "ArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptorMap", + "name": "ArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Object", + "name": "ArrayBufferLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "ObjectConstructor", + "name": "ArrayBufferTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Function", + "name": "ArrayBufferView", "identifiers": [], "defs": [], "references": [] }, { - "name": "FunctionConstructor", + "name": "ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisParameterType", + "name": "ArrayLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "OmitThisParameter", + "name": "Awaited", "identifiers": [], "defs": [], "references": [] }, { - "name": "CallableFunction", + "name": "Boolean", "identifiers": [], "defs": [], "references": [] }, { - "name": "NewableFunction", + "name": "BooleanConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IArguments", + "name": "CallableFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "String", + "name": "Capitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "StringConstructor", + "name": "ConcatArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Boolean", + "name": "ConstructorParameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "BooleanConstructor", + "name": "DataView", "identifiers": [], "defs": [], "references": [] }, { - "name": "Number", + "name": "DataViewConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NumberConstructor", + "name": "Date", "identifiers": [], "defs": [], "references": [] }, { - "name": "TemplateStringsArray", + "name": "DateConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportMeta", + "name": "Error", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportCallOptions", + "name": "ErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportAssertions", + "name": "EvalError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Math", + "name": "EvalErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Date", + "name": "Exclude", "identifiers": [], "defs": [], "references": [] }, { - "name": "DateConstructor", + "name": "Extract", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpMatchArray", + "name": "Float32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpExecArray", + "name": "Float32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExp", + "name": "Float64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpConstructor", + "name": "Float64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Error", + "name": "Function", "identifiers": [], "defs": [], "references": [] }, { - "name": "ErrorConstructor", + "name": "FunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalError", + "name": "IArguments", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalErrorConstructor", + "name": "ImportAssertions", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeError", + "name": "ImportAttributes", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeErrorConstructor", + "name": "ImportCallOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceError", + "name": "ImportMeta", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceErrorConstructor", + "name": "InstanceType", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxError", + "name": "Int8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxErrorConstructor", + "name": "Int8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeError", + "name": "Int16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeErrorConstructor", + "name": "Int16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIError", + "name": "Int32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIErrorConstructor", + "name": "Int32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Intl", "identifiers": [], "defs": [], "references": [] @@ -356,79 +368,79 @@ "references": [] }, { - "name": "ReadonlyArray", + "name": "Lowercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConcatArray", + "name": "Math", "identifiers": [], "defs": [], "references": [] }, { - "name": "Array", + "name": "NewableFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayConstructor", + "name": "NoInfer", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypedPropertyDescriptor", + "name": "NonNullable", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructorLike", + "name": "Number", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseLike", + "name": "NumberConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Promise", + "name": "Object", "identifiers": [], "defs": [], "references": [] }, { - "name": "Awaited", + "name": "ObjectConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayLike", + "name": "Omit", "identifiers": [], "defs": [], "references": [] }, { - "name": "Partial", + "name": "OmitThisParameter", "identifiers": [], "defs": [], "references": [] }, { - "name": "Required", + "name": "Parameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "Readonly", + "name": "Partial", "identifiers": [], "defs": [], "references": [] @@ -440,283 +452,283 @@ "references": [] }, { - "name": "Record", + "name": "Promise", "identifiers": [], "defs": [], "references": [] }, { - "name": "Exclude", + "name": "PromiseConstructorLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "Extract", + "name": "PromiseLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "Omit", + "name": "PropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NonNullable", + "name": "PropertyDescriptorMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Parameters", + "name": "PropertyKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConstructorParameters", + "name": "RangeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReturnType", + "name": "RangeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "InstanceType", + "name": "Readonly", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uppercase", + "name": "ReadonlyArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Lowercase", + "name": "Record", "identifiers": [], "defs": [], "references": [] }, { - "name": "Capitalize", + "name": "ReferenceError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uncapitalize", + "name": "ReferenceErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisType", + "name": "RegExp", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBuffer", + "name": "RegExpConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferTypes", + "name": "RegExpExecArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferLike", + "name": "RegExpMatchArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferConstructor", + "name": "Required", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferView", + "name": "ReturnType", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataView", + "name": "String", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataViewConstructor", + "name": "StringConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8Array", + "name": "Symbol", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8ArrayConstructor", + "name": "SyntaxError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8Array", + "name": "SyntaxErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ArrayConstructor", + "name": "TemplateStringsArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArray", + "name": "ThisParameterType", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArrayConstructor", + "name": "ThisType", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16Array", + "name": "TypedPropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16ArrayConstructor", + "name": "TypeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16Array", + "name": "TypeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16ArrayConstructor", + "name": "Uint8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32Array", + "name": "Uint8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32ArrayConstructor", + "name": "Uint8ClampedArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32Array", + "name": "Uint8ClampedArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32ArrayConstructor", + "name": "Uint16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32Array", + "name": "Uint16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32ArrayConstructor", + "name": "Uint32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64Array", + "name": "Uint32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64ArrayConstructor", + "name": "Uncapitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "Intl", + "name": "Uppercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "Map", + "name": "URIError", "identifiers": [], "defs": [], "references": [] }, { - "name": "MapConstructor", + "name": "URIErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlyMap", + "name": "WeakKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMap", + "name": "WeakKeyTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMapConstructor", + "name": "Map", "identifiers": [], "defs": [], "references": [] }, { - "name": "Set", + "name": "MapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SetConstructor", + "name": "ReadonlyMap", "identifiers": [], "defs": [], "references": [] @@ -728,85 +740,139 @@ "references": [] }, { - "name": "WeakSet", + "name": "Set", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakSetConstructor", + "name": "SetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SymbolConstructor", + "name": "WeakMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorYieldResult", + "name": "WeakMapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorReturnResult", + "name": "WeakSet", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorResult", + "name": "WeakSetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterator", + "name": "SymbolConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterable", + "name": "ArrayIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "IterableIterator", + "name": "BuiltinIteratorReturn", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructor", + "name": "Iterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "Generator", + "name": "IterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunction", + "name": "Iterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunctionConstructor", + "name": "IteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyHandler", + "name": "IteratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorReturnResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorYieldResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "MapIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SetIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "StringIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Generator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "GeneratorFunction", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "GeneratorFunctionConstructor", "identifiers": [], "defs": [], "references": [] @@ -817,12 +883,24 @@ "defs": [], "references": [] }, + { + "name": "ProxyHandler", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "Reflect", "identifiers": [], "defs": [], "references": [] }, + { + "name": "Atomics", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "SharedArrayBuffer", "identifiers": [], @@ -836,25 +914,25 @@ "references": [] }, { - "name": "Atomics", + "name": "AsyncIterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterator", + "name": "AsyncIterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterable", + "name": "AsyncIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterableIterator", + "name": "AsyncIteratorObject", "identifiers": [], "defs": [], "references": [] @@ -877,6 +955,192 @@ "defs": [], "references": [] }, + { + "name": "FlatArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigIntConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigIntToLocaleStringOptions", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigUint64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigUint64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseFulfilledResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseRejectedResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseSettledResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RegExpStringIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AggregateError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AggregateErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FinalizationRegistry", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FinalizationRegistryConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakRef", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakRefConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ErrorOptions", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RegExpIndicesArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseWithResolvers", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposableStack", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposableStackConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Disposable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DisposableStack", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DisposableStackConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SuppressedError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SuppressedErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ReadonlySetLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorObjectConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "const", "identifiers": [], @@ -893,13 +1157,13 @@ "type": "Identifier", "name": "defineModel", "loc": { - "start": { - "line": 2, - "column": 32 - }, "end": { "line": 2, "column": 43 + }, + "start": { + "line": 2, + "column": 32 } } }, @@ -921,13 +1185,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 7 - }, "end": { "line": 2, "column": 17 + }, + "start": { + "line": 2, + "column": 7 } } } @@ -938,13 +1202,13 @@ "node": { "type": "VariableDeclarator", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 9, "column": 2 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -957,13 +1221,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 7 - }, "end": { "line": 2, "column": 17 + }, + "start": { + "line": 2, + "column": 7 } } }, @@ -972,13 +1236,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 7 - }, "end": { "line": 2, "column": 17 + }, + "start": { + "line": 2, + "column": 7 } } }, @@ -989,13 +1253,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 7 - }, "end": { "line": 2, "column": 17 + }, + "start": { + "line": 2, + "column": 7 } } }, @@ -1004,13 +1268,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 7 - }, "end": { "line": 2, "column": 17 + }, + "start": { + "line": 2, + "column": 7 } } }, @@ -1026,13 +1290,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 28 + }, + "start": { + "line": 2, + "column": 19 } } } @@ -1043,13 +1307,13 @@ "node": { "type": "VariableDeclarator", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 9, "column": 2 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1062,13 +1326,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 28 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -1077,13 +1341,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 28 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -1094,13 +1358,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 4, - "column": 8 - }, "end": { "line": 4, "column": 17 + }, + "start": { + "line": 4, + "column": 8 } } }, @@ -1109,13 +1373,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 28 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -1130,13 +1394,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 7 - }, "end": { "line": 2, "column": 17 + }, + "start": { + "line": 2, + "column": 7 } } }, @@ -1145,13 +1409,13 @@ "type": "Identifier", "name": "modelValue", "loc": { - "start": { - "line": 2, - "column": 7 - }, "end": { "line": 2, "column": 17 + }, + "start": { + "line": 2, + "column": 7 } } }, @@ -1162,13 +1426,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 28 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -1177,13 +1441,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 28 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -1194,13 +1458,13 @@ "type": "Identifier", "name": "defineModel", "loc": { - "start": { - "line": 2, - "column": 32 - }, "end": { "line": 2, "column": 43 + }, + "start": { + "line": 2, + "column": 32 } } }, @@ -1225,13 +1489,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 3, - "column": 6 - }, "end": { "line": 3, "column": 11 + }, + "start": { + "line": 3, + "column": 6 } } } @@ -1242,13 +1506,13 @@ "node": { "type": "FunctionExpression", "loc": { - "start": { - "line": 3, - "column": 5 - }, "end": { "line": 8, "column": 3 + }, + "start": { + "line": 3, + "column": 5 } } }, @@ -1261,13 +1525,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 5, - "column": 13 - }, "end": { "line": 5, "column": 18 + }, + "start": { + "line": 5, + "column": 13 } } }, @@ -1276,13 +1540,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 3, - "column": 6 - }, "end": { "line": 3, "column": 11 + }, + "start": { + "line": 3, + "column": 6 } } }, @@ -1293,13 +1557,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 7, - "column": 11 - }, "end": { "line": 7, "column": 16 + }, + "start": { + "line": 7, + "column": 11 } } }, @@ -1308,13 +1572,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 3, - "column": 6 - }, "end": { "line": 3, "column": 11 + }, + "start": { + "line": 3, + "column": 6 } } }, @@ -1329,13 +1593,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 4, - "column": 8 - }, "end": { "line": 4, "column": 17 + }, + "start": { + "line": 4, + "column": 8 } } }, @@ -1344,13 +1608,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 28 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -1361,13 +1625,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 7, - "column": 11 - }, "end": { "line": 7, "column": 16 + }, + "start": { + "line": 7, + "column": 11 } } }, @@ -1376,13 +1640,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 3, - "column": 6 - }, "end": { "line": 3, "column": 11 + }, + "start": { + "line": 3, + "column": 6 } } }, @@ -1399,13 +1663,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 5, - "column": 13 - }, "end": { "line": 5, "column": 18 + }, + "start": { + "line": 5, + "column": 13 } } }, @@ -1414,13 +1678,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 3, - "column": 6 - }, "end": { "line": 3, "column": 11 + }, + "start": { + "line": 3, + "column": 6 } } }, @@ -1434,13 +1698,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 5, - "column": 13 - }, "end": { "line": 5, "column": 18 + }, + "start": { + "line": 5, + "column": 13 } } }, @@ -1449,13 +1713,13 @@ "type": "Identifier", "name": "value", "loc": { - "start": { - "line": 3, - "column": 6 - }, "end": { "line": 3, "column": 11 + }, + "start": { + "line": 3, + "column": 6 } } }, @@ -1470,13 +1734,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 4, - "column": 8 - }, "end": { "line": 4, "column": 17 + }, + "start": { + "line": 4, + "column": 8 } } }, @@ -1485,13 +1749,13 @@ "type": "Identifier", "name": "modifiers", "loc": { - "start": { - "line": 2, - "column": 19 - }, "end": { "line": 2, "column": 28 + }, + "start": { + "line": 2, + "column": 19 } } }, @@ -1506,13 +1770,13 @@ "type": "Identifier", "name": "defineModel", "loc": { - "start": { - "line": 2, - "column": 32 - }, "end": { "line": 2, "column": 43 + }, + "start": { + "line": 2, + "column": 32 } } }, diff --git a/test/fixtures/ast/define-slots01/ast.json b/test/fixtures/ast/define-slots01/ast.json index 1dd238e5..e6d06d60 100644 --- a/test/fixtures/ast/define-slots01/ast.json +++ b/test/fixtures/ast/define-slots01/ast.json @@ -1,66 +1,61 @@ { "type": "Program", + "range": [ + 25, + 97 + ], "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "slots", + "optional": false, "range": [ 31, 36 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 11 + }, + "start": { + "line": 2, + "column": 6 } } }, "init": { "type": "CallExpression", + "arguments": [], "callee": { "type": "Identifier", + "decorators": [], "name": "defineSlots", + "optional": false, "range": [ 39, 50 ], "loc": { - "start": { - "line": 2, - "column": 14 - }, "end": { "line": 2, "column": 25 + }, + "start": { + "line": 2, + "column": 14 } } }, - "arguments": [], "optional": false, - "range": [ - 39, - 96 - ], - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 4, - "column": 4 - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 50, @@ -75,50 +70,42 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "default", + "optional": false, "range": [ 55, 62 ], "loc": { - "start": { - "line": 3, - "column": 2 - }, "end": { "line": 3, "column": 9 + }, + "start": { + "line": 3, + "column": 2 } } }, + "kind": "method", + "optional": false, "params": [ { "type": "Identifier", + "decorators": [], "name": "props", - "range": [ - 63, - 85 - ], - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "optional": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 3, - "column": 15 - }, "end": { "line": 3, "column": 32 + }, + "start": { + "line": 3, + "column": 15 } }, "range": [ @@ -133,32 +120,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "msg", + "optional": false, "range": [ 72, 75 ], "loc": { - "start": { - "line": 3, - "column": 19 - }, "end": { "line": 3, "column": 22 + }, + "start": { + "line": 3, + "column": 19 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 3, - "column": 22 - }, "end": { "line": 3, "column": 30 + }, + "start": { + "line": 3, + "column": 22 } }, "range": [ @@ -172,13 +164,13 @@ 83 ], "loc": { - "start": { - "line": 3, - "column": 24 - }, "end": { "line": 3, "column": 30 + }, + "start": { + "line": 3, + "column": 24 } } } @@ -188,13 +180,13 @@ 83 ], "loc": { - "start": { - "line": 3, - "column": 19 - }, "end": { "line": 3, "column": 30 + }, + "start": { + "line": 3, + "column": 19 } } } @@ -204,44 +196,44 @@ 85 ], "loc": { - "start": { - "line": 3, - "column": 17 - }, "end": { "line": 3, "column": 32 + }, + "start": { + "line": 3, + "column": 17 } } } + }, + "range": [ + 63, + 85 + ], + "loc": { + "end": { + "line": 3, + "column": 32 + }, + "start": { + "line": 3, + "column": 10 + } } } ], - "kind": "method", - "range": [ - 55, - 91 - ], - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 38 - } - }, + "readonly": false, "returnType": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 3, - "column": 33 - }, "end": { "line": 3, "column": 38 + }, + "start": { + "line": 3, + "column": 33 } }, "range": [ @@ -255,16 +247,31 @@ 91 ], "loc": { - "start": { - "line": 3, - "column": 35 - }, "end": { "line": 3, "column": 38 + }, + "start": { + "line": 3, + "column": 35 } } } + }, + "static": false, + "range": [ + 55, + 91 + ], + "loc": { + "end": { + "line": 3, + "column": 38 + }, + "start": { + "line": 3, + "column": 2 + } } } ], @@ -273,27 +280,41 @@ 93 ], "loc": { - "start": { - "line": 2, - "column": 26 - }, "end": { "line": 4, "column": 1 + }, + "start": { + "line": 2, + "column": 26 } } } ], "loc": { - "start": { - "line": 2, - "column": 25 - }, "end": { "line": 4, "column": 2 + }, + "start": { + "line": 2, + "column": 25 } } + }, + "range": [ + 39, + 96 + ], + "loc": { + "end": { + "line": 4, + "column": 4 + }, + "start": { + "line": 2, + "column": 14 + } } }, "range": [ @@ -301,49 +322,37 @@ 96 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 4, "column": 4 + }, + "start": { + "line": 2, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 25, 96 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 4, "column": 4 + }, + "start": { + "line": 2, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 25, - 97 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 5, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -365,399 +374,399 @@ }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 2, + "column": 5 + }, + "start": { + "line": 2, + "column": 0 + } + }, "range": [ 25, 30 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 0 + "column": 11 }, - "end": { + "start": { "line": 2, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "slots", + }, "range": [ 31, 36 ], + "value": "slots" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 6 + "column": 13 }, - "end": { + "start": { "line": 2, - "column": 11 + "column": 12 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 37, 38 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 12 + "column": 25 }, - "end": { + "start": { "line": 2, - "column": 13 + "column": 14 } - } - }, - { - "type": "Identifier", - "value": "defineSlots", + }, "range": [ 39, 50 ], + "value": "defineSlots" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 14 + "column": 26 }, - "end": { + "start": { "line": 2, "column": 25 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 50, 51 ], + "value": "<" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 25 + "column": 27 }, - "end": { + "start": { "line": 2, "column": 26 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 51, 52 ], - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 27 - } - } + "value": "{" }, { "type": "Keyword", - "value": "default", + "loc": { + "end": { + "line": 3, + "column": 9 + }, + "start": { + "line": 3, + "column": 2 + } + }, "range": [ 55, 62 ], + "value": "default" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 2 + "column": 10 }, - "end": { + "start": { "line": 3, "column": 9 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 62, 63 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 9 + "column": 15 }, - "end": { + "start": { "line": 3, "column": 10 } - } - }, - { - "type": "Identifier", - "value": "props", + }, "range": [ 63, 68 ], + "value": "props" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 10 + "column": 16 }, - "end": { + "start": { "line": 3, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 68, 69 ], + "value": ":" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 15 + "column": 18 }, - "end": { + "start": { "line": 3, - "column": 16 + "column": 17 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 70, 71 ], + "value": "{" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 17 + "column": 22 }, - "end": { + "start": { "line": 3, - "column": 18 + "column": 19 } - } - }, - { - "type": "Identifier", - "value": "msg", + }, "range": [ 72, 75 ], + "value": "msg" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 19 + "column": 23 }, - "end": { + "start": { "line": 3, "column": 22 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 75, 76 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 22 + "column": 30 }, - "end": { + "start": { "line": 3, - "column": 23 + "column": 24 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 77, 83 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 24 + "column": 32 }, - "end": { + "start": { "line": 3, - "column": 30 + "column": 31 } - } - }, - { - "type": "Punctuator", - "value": "}", + }, "range": [ 84, 85 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 31 + "column": 33 }, - "end": { + "start": { "line": 3, "column": 32 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 85, 86 ], + "value": ")" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 32 + "column": 34 }, - "end": { + "start": { "line": 3, "column": 33 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 86, 87 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 33 + "column": 38 }, - "end": { + "start": { "line": 3, - "column": 34 + "column": 35 } - } - }, - { - "type": "Identifier", - "value": "any", + }, "range": [ 88, 91 ], - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 38 - } - } + "value": "any" }, { "type": "Punctuator", - "value": "}", + "loc": { + "end": { + "line": 4, + "column": 1 + }, + "start": { + "line": 4, + "column": 0 + } + }, "range": [ 92, 93 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 4, - "column": 0 + "column": 2 }, - "end": { + "start": { "line": 4, "column": 1 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 93, 94 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 4, - "column": 1 + "column": 3 }, - "end": { + "start": { "line": 4, "column": 2 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 94, 95 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 4, - "column": 2 + "column": 4 }, - "end": { + "start": { "line": 4, "column": 3 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 95, 96 ], - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 4 - } - } + "value": ")" }, { "type": "Punctuator", @@ -778,5 +787,14 @@ "value": "" } ], - "comments": [] + "loc": { + "end": { + "line": 5, + "column": 0 + }, + "start": { + "line": 2, + "column": 0 + } + } } \ No newline at end of file diff --git a/test/fixtures/ast/define-slots01/scope.json b/test/fixtures/ast/define-slots01/scope.json index 3a65764c..bb288781 100644 --- a/test/fixtures/ast/define-slots01/scope.json +++ b/test/fixtures/ast/define-slots01/scope.json @@ -2,13 +2,19 @@ "type": "global", "variables": [ { - "name": "ClassMemberDecoratorContext", + "name": "ClassAccessorDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "DecoratorContext", + "name": "ClassAccessorDecoratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorTarget", "identifiers": [], "defs": [], "references": [] @@ -20,7 +26,7 @@ "references": [] }, { - "name": "ClassMethodDecoratorContext", + "name": "ClassFieldDecoratorContext", "identifiers": [], "defs": [], "references": [] @@ -32,43 +38,43 @@ "references": [] }, { - "name": "ClassSetterDecoratorContext", + "name": "ClassMemberDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorContext", + "name": "ClassMethodDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorTarget", + "name": "ClassSetterDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorResult", + "name": "DecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassFieldDecoratorContext", + "name": "DecoratorMetadata", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassDecorator", + "name": "DecoratorMetadataObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDecorator", + "name": "ClassDecorator", "identifiers": [], "defs": [], "references": [] @@ -86,61 +92,73 @@ "references": [] }, { - "name": "Symbol", + "name": "PropertyDecorator", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyKey", + "name": "Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptor", + "name": "ArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptorMap", + "name": "ArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Object", + "name": "ArrayBufferLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "ObjectConstructor", + "name": "ArrayBufferTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Function", + "name": "ArrayBufferView", "identifiers": [], "defs": [], "references": [] }, { - "name": "FunctionConstructor", + "name": "ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisParameterType", + "name": "ArrayLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "OmitThisParameter", + "name": "Awaited", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Boolean", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BooleanConstructor", "identifiers": [], "defs": [], "references": [] @@ -152,7 +170,115 @@ "references": [] }, { - "name": "NewableFunction", + "name": "Capitalize", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ConcatArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ConstructorParameters", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DataView", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DataViewConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Date", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DateConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Error", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "EvalError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "EvalErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Exclude", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Extract", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float32Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Float64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Function", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FunctionConstructor", "identifiers": [], "defs": [], "references": [] @@ -164,25 +290,109 @@ "references": [] }, { - "name": "String", + "name": "ImportAssertions", "identifiers": [], "defs": [], "references": [] }, { - "name": "StringConstructor", + "name": "ImportAttributes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Boolean", + "name": "ImportCallOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "BooleanConstructor", + "name": "ImportMeta", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "InstanceType", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int8Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int8ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int16Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int16ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int32Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Int32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Intl", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "JSON", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Lowercase", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Math", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "NewableFunction", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "NoInfer", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "NonNullable", "identifiers": [], "defs": [], "references": [] @@ -200,679 +410,733 @@ "references": [] }, { - "name": "TemplateStringsArray", + "name": "Object", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportMeta", + "name": "ObjectConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportCallOptions", + "name": "Omit", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportAssertions", + "name": "OmitThisParameter", "identifiers": [], "defs": [], "references": [] }, { - "name": "Math", + "name": "Parameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "Date", + "name": "Partial", "identifiers": [], "defs": [], "references": [] }, { - "name": "DateConstructor", + "name": "Pick", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpMatchArray", + "name": "Promise", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpExecArray", + "name": "PromiseConstructorLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PropertyDescriptor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PropertyDescriptorMap", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PropertyKey", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RangeError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RangeErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Readonly", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ReadonlyArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Record", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExp", + "name": "ReferenceError", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpConstructor", + "name": "ReferenceErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Error", + "name": "RegExp", "identifiers": [], "defs": [], "references": [] }, { - "name": "ErrorConstructor", + "name": "RegExpConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalError", + "name": "RegExpExecArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalErrorConstructor", + "name": "RegExpMatchArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeError", + "name": "Required", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeErrorConstructor", + "name": "ReturnType", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceError", + "name": "String", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceErrorConstructor", + "name": "StringConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxError", + "name": "Symbol", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxErrorConstructor", + "name": "SyntaxError", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeError", + "name": "SyntaxErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeErrorConstructor", + "name": "TemplateStringsArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIError", + "name": "ThisParameterType", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIErrorConstructor", + "name": "ThisType", "identifiers": [], "defs": [], "references": [] }, { - "name": "JSON", + "name": "TypedPropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlyArray", + "name": "TypeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConcatArray", + "name": "TypeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Array", + "name": "Uint8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayConstructor", + "name": "Uint8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypedPropertyDescriptor", + "name": "Uint8ClampedArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructorLike", + "name": "Uint8ClampedArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseLike", + "name": "Uint16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Promise", + "name": "Uint16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Awaited", + "name": "Uint32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayLike", + "name": "Uint32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Partial", + "name": "Uncapitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "Required", + "name": "Uppercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "Readonly", + "name": "URIError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Pick", + "name": "URIErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Record", + "name": "WeakKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "Exclude", + "name": "WeakKeyTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Extract", + "name": "Map", "identifiers": [], "defs": [], "references": [] }, { - "name": "Omit", + "name": "MapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NonNullable", + "name": "ReadonlyMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Parameters", + "name": "ReadonlySet", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConstructorParameters", + "name": "Set", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReturnType", + "name": "SetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "InstanceType", + "name": "WeakMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uppercase", + "name": "WeakMapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Lowercase", + "name": "WeakSet", "identifiers": [], "defs": [], "references": [] }, { - "name": "Capitalize", + "name": "WeakSetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uncapitalize", + "name": "SymbolConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisType", + "name": "ArrayIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBuffer", + "name": "BuiltinIteratorReturn", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferTypes", + "name": "Iterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferLike", + "name": "IterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferConstructor", + "name": "Iterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferView", + "name": "IteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataView", + "name": "IteratorResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataViewConstructor", + "name": "IteratorReturnResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8Array", + "name": "IteratorYieldResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8ArrayConstructor", + "name": "MapIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8Array", + "name": "PromiseConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ArrayConstructor", + "name": "SetIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArray", + "name": "StringIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArrayConstructor", + "name": "Generator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16Array", + "name": "GeneratorFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16ArrayConstructor", + "name": "GeneratorFunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16Array", + "name": "ProxyConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16ArrayConstructor", + "name": "ProxyHandler", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32Array", + "name": "Reflect", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32ArrayConstructor", + "name": "Atomics", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32Array", + "name": "SharedArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32ArrayConstructor", + "name": "SharedArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32Array", + "name": "AsyncIterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32ArrayConstructor", + "name": "AsyncIterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64Array", + "name": "AsyncIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64ArrayConstructor", + "name": "AsyncIteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "Intl", + "name": "AsyncGenerator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Map", + "name": "AsyncGeneratorFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "MapConstructor", + "name": "AsyncGeneratorFunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlyMap", + "name": "FlatArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMap", + "name": "BigInt", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMapConstructor", + "name": "BigInt64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Set", + "name": "BigInt64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SetConstructor", + "name": "BigIntConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlySet", + "name": "BigIntToLocaleStringOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakSet", + "name": "BigUint64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakSetConstructor", + "name": "BigUint64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SymbolConstructor", + "name": "PromiseFulfilledResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorYieldResult", + "name": "PromiseRejectedResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorReturnResult", + "name": "PromiseSettledResult", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorResult", + "name": "RegExpStringIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterator", + "name": "AggregateError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterable", + "name": "AggregateErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IterableIterator", + "name": "FinalizationRegistry", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructor", + "name": "FinalizationRegistryConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Generator", + "name": "WeakRef", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunction", + "name": "WeakRefConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunctionConstructor", + "name": "ErrorOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyHandler", + "name": "RegExpIndicesArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyConstructor", + "name": "PromiseWithResolvers", "identifiers": [], "defs": [], "references": [] }, { - "name": "Reflect", + "name": "AsyncDisposable", "identifiers": [], "defs": [], "references": [] }, { - "name": "SharedArrayBuffer", + "name": "AsyncDisposableStack", "identifiers": [], "defs": [], "references": [] }, { - "name": "SharedArrayBufferConstructor", + "name": "AsyncDisposableStackConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Atomics", + "name": "Disposable", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterator", + "name": "DisposableStack", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterable", + "name": "DisposableStackConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterableIterator", + "name": "SuppressedError", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncGenerator", + "name": "SuppressedErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncGeneratorFunction", + "name": "ReadonlySetLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncGeneratorFunctionConstructor", + "name": "IteratorObjectConstructor", "identifiers": [], "defs": [], "references": [] @@ -893,13 +1157,13 @@ "type": "Identifier", "name": "defineSlots", "loc": { - "start": { - "line": 2, - "column": 14 - }, "end": { "line": 2, "column": 25 + }, + "start": { + "line": 2, + "column": 14 } } }, @@ -921,13 +1185,13 @@ "type": "Identifier", "name": "slots", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 11 + }, + "start": { + "line": 2, + "column": 6 } } } @@ -938,13 +1202,13 @@ "node": { "type": "VariableDeclarator", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 4, "column": 4 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -957,13 +1221,13 @@ "type": "Identifier", "name": "slots", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 11 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -972,13 +1236,13 @@ "type": "Identifier", "name": "slots", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 11 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -993,13 +1257,13 @@ "type": "Identifier", "name": "slots", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 11 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1008,13 +1272,13 @@ "type": "Identifier", "name": "slots", "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 11 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -1025,13 +1289,13 @@ "type": "Identifier", "name": "defineSlots", "loc": { - "start": { - "line": 2, - "column": 14 - }, "end": { "line": 2, "column": 25 + }, + "start": { + "line": 2, + "column": 14 } } }, @@ -1050,13 +1314,13 @@ "type": "Identifier", "name": "props", "loc": { - "start": { - "line": 3, - "column": 10 - }, "end": { "line": 3, "column": 32 + }, + "start": { + "line": 3, + "column": 10 } } } @@ -1067,13 +1331,13 @@ "node": { "type": "TSMethodSignature", "loc": { - "start": { - "line": 3, - "column": 2 - }, "end": { "line": 3, "column": 38 + }, + "start": { + "line": 3, + "column": 2 } } }, @@ -1094,13 +1358,13 @@ "type": "Identifier", "name": "defineSlots", "loc": { - "start": { - "line": 2, - "column": 14 - }, "end": { "line": 2, "column": 25 + }, + "start": { + "line": 2, + "column": 14 } } }, diff --git a/test/fixtures/ast/directive-argument-and-modifiers/ast.json b/test/fixtures/ast/directive-argument-and-modifiers/ast.json index afca550e..a9f45e97 100644 --- a/test/fixtures/ast/directive-argument-and-modifiers/ast.json +++ b/test/fixtures/ast/directive-argument-and-modifiers/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/directive-arguments/ast.json b/test/fixtures/ast/directive-arguments/ast.json index 79f08bb1..6332d0bc 100644 --- a/test/fixtures/ast/directive-arguments/ast.json +++ b/test/fixtures/ast/directive-arguments/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/directive-empty-value/ast.json b/test/fixtures/ast/directive-empty-value/ast.json index 70f6eed9..27c2b1f4 100644 --- a/test/fixtures/ast/directive-empty-value/ast.json +++ b/test/fixtures/ast/directive-empty-value/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/directive-error-1/ast.json b/test/fixtures/ast/directive-error-1/ast.json index c784b8d6..27e6fc4c 100644 --- a/test/fixtures/ast/directive-error-1/ast.json +++ b/test/fixtures/ast/directive-error-1/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/directive-error-2/ast.json b/test/fixtures/ast/directive-error-2/ast.json index f59e6a92..a91128fe 100644 --- a/test/fixtures/ast/directive-error-2/ast.json +++ b/test/fixtures/ast/directive-error-2/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/directive-error-3/ast.json b/test/fixtures/ast/directive-error-3/ast.json index b7e95cc6..3883279f 100644 --- a/test/fixtures/ast/directive-error-3/ast.json +++ b/test/fixtures/ast/directive-error-3/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/directive-error-4/ast.json b/test/fixtures/ast/directive-error-4/ast.json index 3888d0db..5fd15aa4 100644 --- a/test/fixtures/ast/directive-error-4/ast.json +++ b/test/fixtures/ast/directive-error-4/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/directive-modifiers/ast.json b/test/fixtures/ast/directive-modifiers/ast.json index 3e8e9d73..c195ea3c 100644 --- a/test/fixtures/ast/directive-modifiers/ast.json +++ b/test/fixtures/ast/directive-modifiers/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/directive-shorthands/ast.json b/test/fixtures/ast/directive-shorthands/ast.json index 0a221c3c..8b371ec6 100644 --- a/test/fixtures/ast/directive-shorthands/ast.json +++ b/test/fixtures/ast/directive-shorthands/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/directives/ast.json b/test/fixtures/ast/directives/ast.json index b78d69a5..0195b968 100644 --- a/test/fixtures/ast/directives/ast.json +++ b/test/fixtures/ast/directives/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/dynamic-argument-dot/ast.json b/test/fixtures/ast/dynamic-argument-dot/ast.json index 6beacb73..5db5ae03 100644 --- a/test/fixtures/ast/dynamic-argument-dot/ast.json +++ b/test/fixtures/ast/dynamic-argument-dot/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/dynamic-argument-error-1/ast.json b/test/fixtures/ast/dynamic-argument-error-1/ast.json index 6a8e5a06..7a92b787 100644 --- a/test/fixtures/ast/dynamic-argument-error-1/ast.json +++ b/test/fixtures/ast/dynamic-argument-error-1/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/dynamic-argument-error-2/ast.json b/test/fixtures/ast/dynamic-argument-error-2/ast.json index a337e3c1..ef8ac183 100644 --- a/test/fixtures/ast/dynamic-argument-error-2/ast.json +++ b/test/fixtures/ast/dynamic-argument-error-2/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/dynamic-argument-error-4/ast.json b/test/fixtures/ast/dynamic-argument-error-4/ast.json index a4b2104e..c95d81f0 100644 --- a/test/fixtures/ast/dynamic-argument-error-4/ast.json +++ b/test/fixtures/ast/dynamic-argument-error-4/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/dynamic-argument-error-5/ast.json b/test/fixtures/ast/dynamic-argument-error-5/ast.json index e5b60f28..293bfa2e 100644 --- a/test/fixtures/ast/dynamic-argument-error-5/ast.json +++ b/test/fixtures/ast/dynamic-argument-error-5/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/dynamic-argument-expr/ast.json b/test/fixtures/ast/dynamic-argument-expr/ast.json index 6c6f087b..f196768c 100644 --- a/test/fixtures/ast/dynamic-argument-expr/ast.json +++ b/test/fixtures/ast/dynamic-argument-expr/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/dynamic-argument-v-bind/ast.json b/test/fixtures/ast/dynamic-argument-v-bind/ast.json index 1e9ff9af..9136b5b5 100644 --- a/test/fixtures/ast/dynamic-argument-v-bind/ast.json +++ b/test/fixtures/ast/dynamic-argument-v-bind/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/dynamic-argument-v-on/ast.json b/test/fixtures/ast/dynamic-argument-v-on/ast.json index c8c1873c..b26e5569 100644 --- a/test/fixtures/ast/dynamic-argument-v-on/ast.json +++ b/test/fixtures/ast/dynamic-argument-v-on/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/dynamic-argument-v-slot/ast.json b/test/fixtures/ast/dynamic-argument-v-slot/ast.json index d98a7503..9273ee82 100644 --- a/test/fixtures/ast/dynamic-argument-v-slot/ast.json +++ b/test/fixtures/ast/dynamic-argument-v-slot/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/elements/ast.json b/test/fixtures/ast/elements/ast.json index 941b75f3..d6629548 100644 --- a/test/fixtures/ast/elements/ast.json +++ b/test/fixtures/ast/elements/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/empty-script-only/ast.json b/test/fixtures/ast/empty-script-only/ast.json index 0900772c..db10289f 100644 --- a/test/fixtures/ast/empty-script-only/ast.json +++ b/test/fixtures/ast/empty-script-only/ast.json @@ -17,7 +17,7 @@ 8 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [ { diff --git a/test/fixtures/ast/empty-template-only/ast.json b/test/fixtures/ast/empty-template-only/ast.json index 01609b68..16a13e3c 100644 --- a/test/fixtures/ast/empty-template-only/ast.json +++ b/test/fixtures/ast/empty-template-only/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/empty/ast.json b/test/fixtures/ast/empty/ast.json index 0905cb4d..a10daf83 100644 --- a/test/fixtures/ast/empty/ast.json +++ b/test/fixtures/ast/empty/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [] } \ No newline at end of file diff --git a/test/fixtures/ast/end-of-line01/ast.json b/test/fixtures/ast/end-of-line01/ast.json index 600e0aaf..2dd0fadf 100644 --- a/test/fixtures/ast/end-of-line01/ast.json +++ b/test/fixtures/ast/end-of-line01/ast.json @@ -99,7 +99,7 @@ "kind": "var" } ], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [ { diff --git a/test/fixtures/ast/end-of-line02/ast.json b/test/fixtures/ast/end-of-line02/ast.json index a4a1bead..392ced18 100644 --- a/test/fixtures/ast/end-of-line02/ast.json +++ b/test/fixtures/ast/end-of-line02/ast.json @@ -99,7 +99,7 @@ "kind": "var" } ], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [ { diff --git a/test/fixtures/ast/error-absence-of-digits-in-numeric-character-reference/ast.json b/test/fixtures/ast/error-absence-of-digits-in-numeric-character-reference/ast.json index e59ed2f9..e69c38ca 100644 --- a/test/fixtures/ast/error-absence-of-digits-in-numeric-character-reference/ast.json +++ b/test/fixtures/ast/error-absence-of-digits-in-numeric-character-reference/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-character-reference-outside-unicode-range/ast.json b/test/fixtures/ast/error-character-reference-outside-unicode-range/ast.json index 33c779c3..fa679dd1 100644 --- a/test/fixtures/ast/error-character-reference-outside-unicode-range/ast.json +++ b/test/fixtures/ast/error-character-reference-outside-unicode-range/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-control-character-reference/ast.json b/test/fixtures/ast/error-control-character-reference/ast.json index c6a2dba7..fdf8c650 100644 --- a/test/fixtures/ast/error-control-character-reference/ast.json +++ b/test/fixtures/ast/error-control-character-reference/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-duplicate-attribute/ast.json b/test/fixtures/ast/error-duplicate-attribute/ast.json index d82cfb06..a9c58684 100644 --- a/test/fixtures/ast/error-duplicate-attribute/ast.json +++ b/test/fixtures/ast/error-duplicate-attribute/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-end-tag-with-attributes/ast.json b/test/fixtures/ast/error-end-tag-with-attributes/ast.json index 696fe712..7322b7cc 100644 --- a/test/fixtures/ast/error-end-tag-with-attributes/ast.json +++ b/test/fixtures/ast/error-end-tag-with-attributes/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-end-tag-with-trailing-solidus/ast.json b/test/fixtures/ast/error-end-tag-with-trailing-solidus/ast.json index 3890be2a..4b466df3 100644 --- a/test/fixtures/ast/error-end-tag-with-trailing-solidus/ast.json +++ b/test/fixtures/ast/error-end-tag-with-trailing-solidus/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-before-tag-name-2/ast.json b/test/fixtures/ast/error-eof-before-tag-name-2/ast.json index 9f8aee7f..15236497 100644 --- a/test/fixtures/ast/error-eof-before-tag-name-2/ast.json +++ b/test/fixtures/ast/error-eof-before-tag-name-2/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-before-tag-name/ast.json b/test/fixtures/ast/error-eof-before-tag-name/ast.json index 06cccbc6..3a40017a 100644 --- a/test/fixtures/ast/error-eof-before-tag-name/ast.json +++ b/test/fixtures/ast/error-eof-before-tag-name/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-cdata/ast.json b/test/fixtures/ast/error-eof-in-cdata/ast.json index de55171f..6ee92a11 100644 --- a/test/fixtures/ast/error-eof-in-cdata/ast.json +++ b/test/fixtures/ast/error-eof-in-cdata/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-comment-2/ast.json b/test/fixtures/ast/error-eof-in-comment-2/ast.json index 75fabe21..f0b7158a 100644 --- a/test/fixtures/ast/error-eof-in-comment-2/ast.json +++ b/test/fixtures/ast/error-eof-in-comment-2/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-comment-3/ast.json b/test/fixtures/ast/error-eof-in-comment-3/ast.json index 3b595b6e..546f7100 100644 --- a/test/fixtures/ast/error-eof-in-comment-3/ast.json +++ b/test/fixtures/ast/error-eof-in-comment-3/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-comment-4/ast.json b/test/fixtures/ast/error-eof-in-comment-4/ast.json index 6087bd52..cb1d7145 100644 --- a/test/fixtures/ast/error-eof-in-comment-4/ast.json +++ b/test/fixtures/ast/error-eof-in-comment-4/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-comment-5/ast.json b/test/fixtures/ast/error-eof-in-comment-5/ast.json index 80d7ae2c..cebbd6ec 100644 --- a/test/fixtures/ast/error-eof-in-comment-5/ast.json +++ b/test/fixtures/ast/error-eof-in-comment-5/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-comment/ast.json b/test/fixtures/ast/error-eof-in-comment/ast.json index d9278c11..c45d5ebe 100644 --- a/test/fixtures/ast/error-eof-in-comment/ast.json +++ b/test/fixtures/ast/error-eof-in-comment/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-tag-2/ast.json b/test/fixtures/ast/error-eof-in-tag-2/ast.json index a643133d..b59cdb7f 100644 --- a/test/fixtures/ast/error-eof-in-tag-2/ast.json +++ b/test/fixtures/ast/error-eof-in-tag-2/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-tag-3/ast.json b/test/fixtures/ast/error-eof-in-tag-3/ast.json index e87d4b72..3008a1c8 100644 --- a/test/fixtures/ast/error-eof-in-tag-3/ast.json +++ b/test/fixtures/ast/error-eof-in-tag-3/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-tag-4/ast.json b/test/fixtures/ast/error-eof-in-tag-4/ast.json index 2ceee212..189f335a 100644 --- a/test/fixtures/ast/error-eof-in-tag-4/ast.json +++ b/test/fixtures/ast/error-eof-in-tag-4/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-tag-5/ast.json b/test/fixtures/ast/error-eof-in-tag-5/ast.json index 2ceee212..189f335a 100644 --- a/test/fixtures/ast/error-eof-in-tag-5/ast.json +++ b/test/fixtures/ast/error-eof-in-tag-5/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-tag-6/ast.json b/test/fixtures/ast/error-eof-in-tag-6/ast.json index 96aa43e0..637a0766 100644 --- a/test/fixtures/ast/error-eof-in-tag-6/ast.json +++ b/test/fixtures/ast/error-eof-in-tag-6/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-tag-7/ast.json b/test/fixtures/ast/error-eof-in-tag-7/ast.json index 95c443ad..ab4d4c67 100644 --- a/test/fixtures/ast/error-eof-in-tag-7/ast.json +++ b/test/fixtures/ast/error-eof-in-tag-7/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-eof-in-tag/ast.json b/test/fixtures/ast/error-eof-in-tag/ast.json index 1f060a42..52f0c380 100644 --- a/test/fixtures/ast/error-eof-in-tag/ast.json +++ b/test/fixtures/ast/error-eof-in-tag/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-invalid-first-character-of-tag-name/ast.json b/test/fixtures/ast/error-invalid-first-character-of-tag-name/ast.json index 853d8334..725d1e82 100644 --- a/test/fixtures/ast/error-invalid-first-character-of-tag-name/ast.json +++ b/test/fixtures/ast/error-invalid-first-character-of-tag-name/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-message-empty/ast.json b/test/fixtures/ast/error-message-empty/ast.json index 6f8a32e2..a2a913e5 100644 --- a/test/fixtures/ast/error-message-empty/ast.json +++ b/test/fixtures/ast/error-message-empty/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-message-outside/ast.json b/test/fixtures/ast/error-message-outside/ast.json index 4e041bcb..5747314c 100644 --- a/test/fixtures/ast/error-message-outside/ast.json +++ b/test/fixtures/ast/error-message-outside/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-missing-end-tag-name/ast.json b/test/fixtures/ast/error-missing-end-tag-name/ast.json index 012ad6a7..1eebe291 100644 --- a/test/fixtures/ast/error-missing-end-tag-name/ast.json +++ b/test/fixtures/ast/error-missing-end-tag-name/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-missing-semicolon-after-character-reference/ast.json b/test/fixtures/ast/error-missing-semicolon-after-character-reference/ast.json index bb29108e..8e8d338c 100644 --- a/test/fixtures/ast/error-missing-semicolon-after-character-reference/ast.json +++ b/test/fixtures/ast/error-missing-semicolon-after-character-reference/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-missing-whitespace-between-attributes/ast.json b/test/fixtures/ast/error-missing-whitespace-between-attributes/ast.json index 5b9f11b7..94602436 100644 --- a/test/fixtures/ast/error-missing-whitespace-between-attributes/ast.json +++ b/test/fixtures/ast/error-missing-whitespace-between-attributes/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-noncharacter-character-reference/ast.json b/test/fixtures/ast/error-noncharacter-character-reference/ast.json index 6b57ead0..48a89100 100644 --- a/test/fixtures/ast/error-noncharacter-character-reference/ast.json +++ b/test/fixtures/ast/error-noncharacter-character-reference/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-null-character-reference/ast.json b/test/fixtures/ast/error-null-character-reference/ast.json index ad092a2a..dedb8c73 100644 --- a/test/fixtures/ast/error-null-character-reference/ast.json +++ b/test/fixtures/ast/error-null-character-reference/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-surrogate-character-reference/ast.json b/test/fixtures/ast/error-surrogate-character-reference/ast.json index be1ba501..8e3bb162 100644 --- a/test/fixtures/ast/error-surrogate-character-reference/ast.json +++ b/test/fixtures/ast/error-surrogate-character-reference/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-unexpected-character-in-attribute-name/ast.json b/test/fixtures/ast/error-unexpected-character-in-attribute-name/ast.json index d9917c99..f74d916f 100644 --- a/test/fixtures/ast/error-unexpected-character-in-attribute-name/ast.json +++ b/test/fixtures/ast/error-unexpected-character-in-attribute-name/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-unexpected-character-in-unquoted-attribute-value/ast.json b/test/fixtures/ast/error-unexpected-character-in-unquoted-attribute-value/ast.json index 05610ed2..c96f41f1 100644 --- a/test/fixtures/ast/error-unexpected-character-in-unquoted-attribute-value/ast.json +++ b/test/fixtures/ast/error-unexpected-character-in-unquoted-attribute-value/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-unexpected-equals-sign-before-attribute-name/ast.json b/test/fixtures/ast/error-unexpected-equals-sign-before-attribute-name/ast.json index fac2297c..7cdf016e 100644 --- a/test/fixtures/ast/error-unexpected-equals-sign-before-attribute-name/ast.json +++ b/test/fixtures/ast/error-unexpected-equals-sign-before-attribute-name/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-unexpected-solidus-in-tag/ast.json b/test/fixtures/ast/error-unexpected-solidus-in-tag/ast.json index 1f336ace..22d04c52 100644 --- a/test/fixtures/ast/error-unexpected-solidus-in-tag/ast.json +++ b/test/fixtures/ast/error-unexpected-solidus-in-tag/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-unknown-named-character-reference/ast.json b/test/fixtures/ast/error-unknown-named-character-reference/ast.json index 3b6d9bbf..7ca7ecf6 100644 --- a/test/fixtures/ast/error-unknown-named-character-reference/ast.json +++ b/test/fixtures/ast/error-unknown-named-character-reference/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-v-on-function-expression/ast.json b/test/fixtures/ast/error-v-on-function-expression/ast.json index 0e6de9bd..4b5630aa 100644 --- a/test/fixtures/ast/error-v-on-function-expression/ast.json +++ b/test/fixtures/ast/error-v-on-function-expression/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-x-invalid-end-tag/ast.json b/test/fixtures/ast/error-x-invalid-end-tag/ast.json index 47e735a7..72d49ae8 100644 --- a/test/fixtures/ast/error-x-invalid-end-tag/ast.json +++ b/test/fixtures/ast/error-x-invalid-end-tag/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/error-x-invalid-namespace/ast.json b/test/fixtures/ast/error-x-invalid-namespace/ast.json index 76d2fd79..876d2520 100644 --- a/test/fixtures/ast/error-x-invalid-namespace/ast.json +++ b/test/fixtures/ast/error-x-invalid-namespace/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/expression-container-only/ast.json b/test/fixtures/ast/expression-container-only/ast.json index 104fd11f..cb659414 100644 --- a/test/fixtures/ast/expression-container-only/ast.json +++ b/test/fixtures/ast/expression-container-only/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/filter-empty/ast.json b/test/fixtures/ast/filter-empty/ast.json index e476fbbb..b7299032 100644 --- a/test/fixtures/ast/filter-empty/ast.json +++ b/test/fixtures/ast/filter-empty/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/filters-2/ast.json b/test/fixtures/ast/filters-2/ast.json index e1a0926b..7de005d1 100644 --- a/test/fixtures/ast/filters-2/ast.json +++ b/test/fixtures/ast/filters-2/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/filters-3/ast.json b/test/fixtures/ast/filters-3/ast.json index 59d0eeaa..24c0fd0d 100644 --- a/test/fixtures/ast/filters-3/ast.json +++ b/test/fixtures/ast/filters-3/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/filters-4/ast.json b/test/fixtures/ast/filters-4/ast.json index 7ed79a2e..4001e0ad 100644 --- a/test/fixtures/ast/filters-4/ast.json +++ b/test/fixtures/ast/filters-4/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/filters-error-2/ast.json b/test/fixtures/ast/filters-error-2/ast.json index 62069a7f..da887d04 100644 --- a/test/fixtures/ast/filters-error-2/ast.json +++ b/test/fixtures/ast/filters-error-2/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/filters-error/ast.json b/test/fixtures/ast/filters-error/ast.json index 83e1718d..a908741d 100644 --- a/test/fixtures/ast/filters-error/ast.json +++ b/test/fixtures/ast/filters-error/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/filters-opt-filter-off/ast.json b/test/fixtures/ast/filters-opt-filter-off/ast.json index 56f5ef80..5f4f64a3 100644 --- a/test/fixtures/ast/filters-opt-filter-off/ast.json +++ b/test/fixtures/ast/filters-opt-filter-off/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/filters-opt-filter-on/ast.json b/test/fixtures/ast/filters-opt-filter-on/ast.json index 5ea7e9fe..adc0b05b 100644 --- a/test/fixtures/ast/filters-opt-filter-on/ast.json +++ b/test/fixtures/ast/filters-opt-filter-on/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/filters/ast.json b/test/fixtures/ast/filters/ast.json index f227023b..e9964d67 100644 --- a/test/fixtures/ast/filters/ast.json +++ b/test/fixtures/ast/filters/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/foreignobject-lower/ast.json b/test/fixtures/ast/foreignobject-lower/ast.json index a0633d60..480e572a 100644 --- a/test/fixtures/ast/foreignobject-lower/ast.json +++ b/test/fixtures/ast/foreignobject-lower/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/foreignobject/ast.json b/test/fixtures/ast/foreignobject/ast.json index b1e10d56..2d0fc692 100644 --- a/test/fixtures/ast/foreignobject/ast.json +++ b/test/fixtures/ast/foreignobject/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/hole-in-array/ast.json b/test/fixtures/ast/hole-in-array/ast.json index 2c8dfa86..f435432e 100644 --- a/test/fixtures/ast/hole-in-array/ast.json +++ b/test/fixtures/ast/hole-in-array/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/html-entities-in-static-places/ast.json b/test/fixtures/ast/html-entities-in-static-places/ast.json index a9c98c69..1959d1b0 100644 --- a/test/fixtures/ast/html-entities-in-static-places/ast.json +++ b/test/fixtures/ast/html-entities-in-static-places/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/html-entities-lone-amp/ast.json b/test/fixtures/ast/html-entities-lone-amp/ast.json index 53e24b47..1714f23d 100644 --- a/test/fixtures/ast/html-entities-lone-amp/ast.json +++ b/test/fixtures/ast/html-entities-lone-amp/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/html-entities-mapping/ast.json b/test/fixtures/ast/html-entities-mapping/ast.json index a4214137..69aab3f9 100644 --- a/test/fixtures/ast/html-entities-mapping/ast.json +++ b/test/fixtures/ast/html-entities-mapping/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/html-entities-numeric/ast.json b/test/fixtures/ast/html-entities-numeric/ast.json index 4c5e77c8..0480cae5 100644 --- a/test/fixtures/ast/html-entities-numeric/ast.json +++ b/test/fixtures/ast/html-entities-numeric/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/html-entities-special-in-attributes/ast.json b/test/fixtures/ast/html-entities-special-in-attributes/ast.json index ef52f027..23c8c433 100644 --- a/test/fixtures/ast/html-entities-special-in-attributes/ast.json +++ b/test/fixtures/ast/html-entities-special-in-attributes/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/html-entities-surrogate-pair-and-expression/ast.json b/test/fixtures/ast/html-entities-surrogate-pair-and-expression/ast.json index 3cf43b01..a499ff27 100644 --- a/test/fixtures/ast/html-entities-surrogate-pair-and-expression/ast.json +++ b/test/fixtures/ast/html-entities-surrogate-pair-and-expression/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/html-entities-with-line-terminators/ast.json b/test/fixtures/ast/html-entities-with-line-terminators/ast.json index ff6d2941..18b3e947 100644 --- a/test/fixtures/ast/html-entities-with-line-terminators/ast.json +++ b/test/fixtures/ast/html-entities-with-line-terminators/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/html-entities/ast.json b/test/fixtures/ast/html-entities/ast.json index 0d9c4201..98faf0df 100644 --- a/test/fixtures/ast/html-entities/ast.json +++ b/test/fixtures/ast/html-entities/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/input-component/ast.json b/test/fixtures/ast/input-component/ast.json index 422c77da..0e782a38 100644 --- a/test/fixtures/ast/input-component/ast.json +++ b/test/fixtures/ast/input-component/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/link-component/ast.json b/test/fixtures/ast/link-component/ast.json index f24d7201..a0ea7e45 100644 --- a/test/fixtures/ast/link-component/ast.json +++ b/test/fixtures/ast/link-component/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/math/ast.json b/test/fixtures/ast/math/ast.json index dacb9357..eaac83cf 100644 --- a/test/fixtures/ast/math/ast.json +++ b/test/fixtures/ast/math/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/multiple-scripts-11/ast.json b/test/fixtures/ast/multiple-scripts-11/ast.json index 87bdc971..0e4de961 100644 --- a/test/fixtures/ast/multiple-scripts-11/ast.json +++ b/test/fixtures/ast/multiple-scripts-11/ast.json @@ -175,7 +175,8 @@ ], "value": "vue", "raw": "'vue'" - } + }, + "attributes": [] }, { "type": "ImportDeclaration", @@ -276,7 +277,8 @@ ], "value": "vuex", "raw": "'vuex'" - } + }, + "attributes": [] }, { "type": "ExportDefaultDeclaration", diff --git a/test/fixtures/ast/multiple-scripts-2/ast.json b/test/fixtures/ast/multiple-scripts-2/ast.json index 3a94a274..345cdacc 100644 --- a/test/fixtures/ast/multiple-scripts-2/ast.json +++ b/test/fixtures/ast/multiple-scripts-2/ast.json @@ -96,7 +96,8 @@ ], "value": "./a", "raw": "'./a'" - } + }, + "attributes": [] }, { "type": "ImportDeclaration", @@ -177,7 +178,8 @@ ], "value": "./a", "raw": "'./a'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", diff --git a/test/fixtures/ast/multiple-scripts-5/ast.json b/test/fixtures/ast/multiple-scripts-5/ast.json index 0c0ff3e9..6b026649 100644 --- a/test/fixtures/ast/multiple-scripts-5/ast.json +++ b/test/fixtures/ast/multiple-scripts-5/ast.json @@ -199,7 +199,8 @@ ], "value": "./Foo.vue", "raw": "'./Foo.vue'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", diff --git a/test/fixtures/ast/multiple-scripts-7/ast.json b/test/fixtures/ast/multiple-scripts-7/ast.json index 6689eb9a..eb6d9eae 100644 --- a/test/fixtures/ast/multiple-scripts-7/ast.json +++ b/test/fixtures/ast/multiple-scripts-7/ast.json @@ -199,7 +199,8 @@ ], "value": "./MyComponent1.vue", "raw": "'./MyComponent1.vue'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", @@ -362,7 +363,8 @@ ], "value": "./MyComponent2.vue", "raw": "'./MyComponent2.vue'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", diff --git a/test/fixtures/ast/multiple-scripts-8/ast.json b/test/fixtures/ast/multiple-scripts-8/ast.json index ba64ede6..2fc13bc3 100644 --- a/test/fixtures/ast/multiple-scripts-8/ast.json +++ b/test/fixtures/ast/multiple-scripts-8/ast.json @@ -261,7 +261,8 @@ ], "value": "./MyComponent1.vue", "raw": "'./MyComponent1.vue'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", @@ -424,7 +425,8 @@ ], "value": "./MyComponent2.vue", "raw": "'./MyComponent2.vue'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", diff --git a/test/fixtures/ast/multiple-scripts-with-export02/ast.json b/test/fixtures/ast/multiple-scripts-with-export02/ast.json index 2d8fc7a3..0d545d97 100644 --- a/test/fixtures/ast/multiple-scripts-with-export02/ast.json +++ b/test/fixtures/ast/multiple-scripts-with-export02/ast.json @@ -178,7 +178,8 @@ ], "value": "a", "raw": "'a'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", @@ -444,7 +445,8 @@ ], "value": "a", "raw": "'a'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", @@ -567,7 +569,8 @@ ], "value": "foo", "raw": "'foo'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", diff --git a/test/fixtures/ast/multiple-scripts-with-export03/ast.json b/test/fixtures/ast/multiple-scripts-with-export03/ast.json index 449ffd40..fff01a7e 100644 --- a/test/fixtures/ast/multiple-scripts-with-export03/ast.json +++ b/test/fixtures/ast/multiple-scripts-with-export03/ast.json @@ -260,7 +260,8 @@ ], "value": "foo", "raw": "'foo'" - } + }, + "attributes": [] }, { "type": "ExportAllDeclaration", @@ -320,7 +321,8 @@ ], "value": "foo", "raw": "'foo'" - } + }, + "attributes": [] }, { "type": "ImportDeclaration", @@ -401,7 +403,8 @@ ], "value": "foo", "raw": "'foo'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", @@ -585,7 +588,8 @@ ], "value": "foo", "raw": "'foo'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", @@ -748,7 +752,8 @@ ], "value": "foo", "raw": "'foo'" - } + }, + "attributes": [] }, { "type": "ExportNamedDeclaration", @@ -850,7 +855,8 @@ ], "value": "foo", "raw": "'foo'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", diff --git a/test/fixtures/ast/multiple-scripts-with-export04/ast.json b/test/fixtures/ast/multiple-scripts-with-export04/ast.json index c95d2858..c7b5583d 100644 --- a/test/fixtures/ast/multiple-scripts-with-export04/ast.json +++ b/test/fixtures/ast/multiple-scripts-with-export04/ast.json @@ -302,7 +302,8 @@ ], "value": "./MyComponent1.vue", "raw": "'./MyComponent1.vue'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", diff --git a/test/fixtures/ast/multiple-scripts-with-ts/ast.json b/test/fixtures/ast/multiple-scripts-with-ts/ast.json index 0f45883f..7a9a4eb9 100644 --- a/test/fixtures/ast/multiple-scripts-with-ts/ast.json +++ b/test/fixtures/ast/multiple-scripts-with-ts/ast.json @@ -1,42 +1,48 @@ { "type": "Program", + "range": [ + 9, + 98 + ], "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", + "arguments": [], "callee": { "type": "Identifier", + "decorators": [], "name": "performGlobalSideEffect", + "optional": false, "range": [ 9, 32 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 23 + }, + "start": { + "line": 2, + "column": 0 } } }, - "arguments": [], "optional": false, "range": [ 9, 34 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 25 + }, + "start": { + "line": 2, + "column": 0 } } }, @@ -45,57 +51,65 @@ 34 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 25 + }, + "start": { + "line": 2, + "column": 0 } } }, { "type": "ExportNamedDeclaration", + "range": [ + 36, + 58 + ], + "attributes": [], "declaration": { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "named", + "optional": false, "range": [ 49, 54 ], "loc": { - "start": { - "line": 4, - "column": 13 - }, "end": { "line": 4, "column": 18 + }, + "start": { + "line": 4, + "column": 13 } } }, "init": { "type": "Literal", - "value": 1, "raw": "1", + "value": 1, "range": [ 57, 58 ], "loc": { - "start": { - "line": 4, - "column": 21 - }, "end": { "line": 4, "column": 22 + }, + "start": { + "line": 4, + "column": 21 } } }, @@ -104,49 +118,45 @@ 58 ], "loc": { - "start": { - "line": 4, - "column": 13 - }, "end": { "line": 4, "column": 22 + }, + "start": { + "line": 4, + "column": 13 } } } ], + "declare": false, "kind": "const", "range": [ 43, 58 ], "loc": { - "start": { - "line": 4, - "column": 7 - }, "end": { "line": 4, "column": 22 + }, + "start": { + "line": 4, + "column": 7 } } }, - "specifiers": [], - "source": null, "exportKind": "value", - "range": [ - 36, - 58 - ], - "assertions": [], + "source": null, + "specifiers": [], "loc": { - "start": { - "line": 4, - "column": 0 - }, "end": { "line": 4, "column": 22 + }, + "start": { + "line": 4, + "column": 0 } } }, @@ -155,40 +165,43 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "count", + "optional": false, "range": [ 89, 94 ], "loc": { - "start": { - "line": 8, - "column": 4 - }, "end": { "line": 8, "column": 9 + }, + "start": { + "line": 8, + "column": 4 } } }, "init": { "type": "Literal", - "value": 0, "raw": "0", + "value": 0, "range": [ 97, 98 ], "loc": { - "start": { - "line": 8, - "column": 12 - }, "end": { "line": 8, "column": 13 + }, + "start": { + "line": 8, + "column": 12 } } }, @@ -197,49 +210,37 @@ 98 ], "loc": { - "start": { - "line": 8, - "column": 4 - }, "end": { "line": 8, "column": 13 + }, + "start": { + "line": 8, + "column": 4 } } } ], + "declare": false, "kind": "let", "range": [ 85, 98 ], "loc": { - "start": { - "line": 8, - "column": 0 - }, "end": { "line": 8, "column": 13 + }, + "start": { + "line": 8, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 9, - 98 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 8, - "column": 13 - } - }, "tokens": [ { "type": "Punctuator", @@ -261,147 +262,147 @@ }, { "type": "Identifier", - "value": "performGlobalSideEffect", + "loc": { + "end": { + "line": 2, + "column": 23 + }, + "start": { + "line": 2, + "column": 0 + } + }, "range": [ 9, 32 ], + "value": "performGlobalSideEffect" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 0 + "column": 24 }, - "end": { + "start": { "line": 2, "column": 23 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 32, 33 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 23 + "column": 25 }, - "end": { + "start": { "line": 2, "column": 24 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 33, 34 ], - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - } + "value": ")" }, { "type": "Keyword", - "value": "export", + "loc": { + "end": { + "line": 4, + "column": 6 + }, + "start": { + "line": 4, + "column": 0 + } + }, "range": [ 36, 42 ], + "value": "export" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 4, - "column": 0 + "column": 12 }, - "end": { + "start": { "line": 4, - "column": 6 + "column": 7 } - } - }, - { - "type": "Keyword", - "value": "const", + }, "range": [ 43, 48 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 7 + "column": 18 }, - "end": { + "start": { "line": 4, - "column": 12 + "column": 13 } - } - }, - { - "type": "Identifier", - "value": "named", + }, "range": [ 49, 54 ], + "value": "named" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 4, - "column": 13 + "column": 20 }, - "end": { + "start": { "line": 4, - "column": 18 + "column": 19 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 55, 56 ], + "value": "=" + }, + { + "type": "Numeric", "loc": { - "start": { + "end": { "line": 4, - "column": 19 + "column": 22 }, - "end": { + "start": { "line": 4, - "column": 20 + "column": 21 } - } - }, - { - "type": "Numeric", - "value": "1", + }, "range": [ 57, 58 ], - "loc": { - "start": { - "line": 4, - "column": 21 - }, - "end": { - "line": 4, - "column": 22 - } - } + "value": "1" }, { "type": "Punctuator", @@ -441,75 +442,75 @@ }, { "type": "Keyword", - "value": "let", + "loc": { + "end": { + "line": 8, + "column": 3 + }, + "start": { + "line": 8, + "column": 0 + } + }, "range": [ 85, 88 ], + "value": "let" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 8, - "column": 0 + "column": 9 }, - "end": { + "start": { "line": 8, - "column": 3 + "column": 4 } - } - }, - { - "type": "Identifier", - "value": "count", + }, "range": [ 89, 94 ], + "value": "count" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 8, - "column": 4 + "column": 11 }, - "end": { + "start": { "line": 8, - "column": 9 + "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 95, 96 ], + "value": "=" + }, + { + "type": "Numeric", "loc": { - "start": { + "end": { "line": 8, - "column": 10 + "column": 13 }, - "end": { + "start": { "line": 8, - "column": 11 + "column": 12 } - } - }, - { - "type": "Numeric", - "value": "0", + }, "range": [ 97, 98 ], - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 13 - } - } + "value": "0" }, { "type": "Punctuator", @@ -530,5 +531,14 @@ "value": "" } ], - "comments": [] + "loc": { + "end": { + "line": 8, + "column": 13 + }, + "start": { + "line": 2, + "column": 0 + } + } } \ No newline at end of file diff --git a/test/fixtures/ast/mustache-errors-opt-interpolation-as-non-html/ast.json b/test/fixtures/ast/mustache-errors-opt-interpolation-as-non-html/ast.json index 712ef57e..3d5e6b8a 100644 --- a/test/fixtures/ast/mustache-errors-opt-interpolation-as-non-html/ast.json +++ b/test/fixtures/ast/mustache-errors-opt-interpolation-as-non-html/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/mustache-errors/ast.json b/test/fixtures/ast/mustache-errors/ast.json index 7d1a3129..9fc7248b 100644 --- a/test/fixtures/ast/mustache-errors/ast.json +++ b/test/fixtures/ast/mustache-errors/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/mustache-in-escape-opt-interpolation-as-non-html/ast.json b/test/fixtures/ast/mustache-in-escape-opt-interpolation-as-non-html/ast.json index 0aa3bd99..b7b14002 100644 --- a/test/fixtures/ast/mustache-in-escape-opt-interpolation-as-non-html/ast.json +++ b/test/fixtures/ast/mustache-in-escape-opt-interpolation-as-non-html/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/ast.json b/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/ast.json index 5f07b6d3..e93aa749 100644 --- a/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/ast.json +++ b/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html-false/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html/ast.json b/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html/ast.json index d039a691..e2f24c2d 100644 --- a/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html/ast.json +++ b/test/fixtures/ast/mustache-in-lt-gt-opt-interpolation-as-non-html/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/mustache-in-lt-gt/ast.json b/test/fixtures/ast/mustache-in-lt-gt/ast.json index d039a691..e2f24c2d 100644 --- a/test/fixtures/ast/mustache-in-lt-gt/ast.json +++ b/test/fixtures/ast/mustache-in-lt-gt/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/ast.json b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/ast.json index 7b15f10c..381c58cc 100644 --- a/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/ast.json +++ b/test/fixtures/ast/mustache-not-closed-opt-interpolation-as-non-html-false/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/mustache-not-closed/ast.json b/test/fixtures/ast/mustache-not-closed/ast.json index 4f81aa1b..87c10c14 100644 --- a/test/fixtures/ast/mustache-not-closed/ast.json +++ b/test/fixtures/ast/mustache-not-closed/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { @@ -1001,10 +1001,10 @@ "column": 11 }, { - "message": "Unexpected end of expression.", - "index": 47, + "message": "Assigning to rvalue", + "index": 36, "lineNumber": 3, - "column": 22 + "column": 11 }, { "message": "Unterminated regular expression", diff --git a/test/fixtures/ast/mustache-with-space/ast.json b/test/fixtures/ast/mustache-with-space/ast.json index 91a6594e..7abbc283 100644 --- a/test/fixtures/ast/mustache-with-space/ast.json +++ b/test/fixtures/ast/mustache-with-space/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/mustache/ast.json b/test/fixtures/ast/mustache/ast.json index 590d2632..0b1fbe13 100644 --- a/test/fixtures/ast/mustache/ast.json +++ b/test/fixtures/ast/mustache/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/no-filters/ast.json b/test/fixtures/ast/no-filters/ast.json index adcb6056..2f1ed4af 100644 --- a/test/fixtures/ast/no-filters/ast.json +++ b/test/fixtures/ast/no-filters/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/not-closing-elements/ast.json b/test/fixtures/ast/not-closing-elements/ast.json index 0ebf4ca1..0c68b5cb 100644 --- a/test/fixtures/ast/not-closing-elements/ast.json +++ b/test/fixtures/ast/not-closing-elements/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/parser-option-multiple-parsers-1/ast.json b/test/fixtures/ast/parser-option-multiple-parsers-1/ast.json index e4419dca..1225bef4 100644 --- a/test/fixtures/ast/parser-option-multiple-parsers-1/ast.json +++ b/test/fixtures/ast/parser-option-multiple-parsers-1/ast.json @@ -1,64 +1,58 @@ { "type": "Program", + "range": [ + 60, + 70 + ], "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "a", - "range": [ - 60, - 61 - ], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - } - }, "arguments": [ { "type": "Identifier", + "decorators": [], "name": "d", + "optional": false, "range": [ 67, 68 ], "loc": { - "start": { - "line": 5, - "column": 9 - }, "end": { "line": 5, "column": 10 + }, + "start": { + "line": 5, + "column": 9 } } } ], - "optional": false, - "range": [ - 60, - 69 - ], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 11 + "callee": { + "type": "Identifier", + "decorators": [], + "name": "a", + "optional": false, + "range": [ + 60, + 61 + ], + "loc": { + "end": { + "line": 5, + "column": 3 + }, + "start": { + "line": 5, + "column": 2 + } } }, - "typeParameters": { + "optional": false, + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 61, @@ -72,19 +66,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "b", + "optional": false, "range": [ 62, 63 ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 4 } } }, @@ -93,13 +89,13 @@ 63 ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 4 } } }, @@ -107,19 +103,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "c", + "optional": false, "range": [ 64, 65 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -128,13 +126,13 @@ 65 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } } @@ -144,27 +142,41 @@ 65 ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 4 } } } ], "loc": { - "start": { - "line": 5, - "column": 3 - }, "end": { "line": 5, "column": 8 + }, + "start": { + "line": 5, + "column": 3 } } + }, + "range": [ + 60, + 69 + ], + "loc": { + "end": { + "line": 5, + "column": 11 + }, + "start": { + "line": 5, + "column": 2 + } } }, "range": [ @@ -172,32 +184,19 @@ 69 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 11 + }, + "start": { + "line": 5, + "column": 2 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 60, - 70 - ], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 6, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -219,165 +218,165 @@ }, { "type": "Identifier", - "value": "a", + "loc": { + "end": { + "line": 5, + "column": 3 + }, + "start": { + "line": 5, + "column": 2 + } + }, "range": [ 60, 61 ], + "value": "a" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 2 + "column": 4 }, - "end": { + "start": { "line": 5, "column": 3 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 61, 62 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 3 + "column": 5 }, - "end": { + "start": { "line": 5, "column": 4 } - } - }, - { - "type": "Identifier", - "value": "b", + }, "range": [ 62, 63 ], + "value": "b" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 4 + "column": 6 }, - "end": { + "start": { "line": 5, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "|", + }, "range": [ 63, 64 ], + "value": "|" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 5 + "column": 7 }, - "end": { + "start": { "line": 5, "column": 6 } - } - }, - { - "type": "Identifier", - "value": "c", + }, "range": [ 64, 65 ], + "value": "c" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 6 + "column": 8 }, - "end": { + "start": { "line": 5, "column": 7 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 65, 66 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 7 + "column": 9 }, - "end": { + "start": { "line": 5, "column": 8 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 66, 67 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 8 + "column": 10 }, - "end": { + "start": { "line": 5, "column": 9 } - } - }, - { - "type": "Identifier", - "value": "d", + }, "range": [ 67, 68 ], + "value": "d" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 9 + "column": 11 }, - "end": { + "start": { "line": 5, "column": 10 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 68, 69 ], - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 11 - } - } + "value": ")" }, { "type": "Punctuator", @@ -398,7 +397,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 6, + "column": 0 + }, + "start": { + "line": 5, + "column": 2 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -474,60 +482,50 @@ }, "expression": { "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "a", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - } - }, "arguments": [ { "type": "Identifier", + "decorators": [], "name": "d", + "optional": false, "range": [ 22, 23 ], "loc": { - "start": { - "line": 2, - "column": 11 - }, "end": { "line": 2, "column": 12 + }, + "start": { + "line": 2, + "column": 11 } } } ], - "optional": false, - "range": [ - 15, - 24 - ], - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 13 + "callee": { + "type": "Identifier", + "decorators": [], + "name": "a", + "optional": false, + "range": [ + 15, + 16 + ], + "loc": { + "end": { + "line": 2, + "column": 5 + }, + "start": { + "line": 2, + "column": 4 + } } }, - "typeParameters": { + "optional": false, + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 16, @@ -541,19 +539,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "b", + "optional": false, "range": [ 17, 18 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 7 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -562,13 +562,13 @@ 18 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 7 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -576,19 +576,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "c", + "optional": false, "range": [ 19, 20 ], "loc": { - "start": { - "line": 2, - "column": 8 - }, "end": { "line": 2, "column": 9 + }, + "start": { + "line": 2, + "column": 8 } } }, @@ -597,13 +599,13 @@ 20 ], "loc": { - "start": { - "line": 2, - "column": 8 - }, "end": { "line": 2, "column": 9 + }, + "start": { + "line": 2, + "column": 8 } } } @@ -613,46 +615,62 @@ 20 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 9 + }, + "start": { + "line": 2, + "column": 6 } } } ], "loc": { - "start": { - "line": 2, - "column": 5 - }, "end": { "line": 2, "column": 10 + }, + "start": { + "line": 2, + "column": 5 } } + }, + "range": [ + 15, + 24 + ], + "loc": { + "end": { + "line": 2, + "column": 13 + }, + "start": { + "line": 2, + "column": 4 + } } }, "references": [ { "id": { "type": "Identifier", + "decorators": [], "name": "a", + "optional": false, "range": [ 15, 16 ], "loc": { - "start": { - "line": 2, - "column": 4 - }, "end": { "line": 2, "column": 5 + }, + "start": { + "line": 2, + "column": 4 } } }, @@ -663,19 +681,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "d", + "optional": false, "range": [ 22, 23 ], "loc": { - "start": { - "line": 2, - "column": 11 - }, "end": { "line": 2, "column": 12 + }, + "start": { + "line": 2, + "column": 11 } } }, @@ -686,19 +706,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "b", + "optional": false, "range": [ 17, 18 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 7 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -709,19 +731,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "c", + "optional": false, "range": [ 19, 20 ], "loc": { - "start": { - "line": 2, - "column": 8 - }, "end": { "line": 2, "column": 9 + }, + "start": { + "line": 2, + "column": 8 } } }, @@ -843,165 +867,165 @@ }, { "type": "Identifier", - "value": "a", + "loc": { + "end": { + "line": 2, + "column": 5 + }, + "start": { + "line": 2, + "column": 4 + } + }, "range": [ 15, 16 ], + "value": "a" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 4 + "column": 6 }, - "end": { + "start": { "line": 2, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 16, 17 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 5 + "column": 7 }, - "end": { + "start": { "line": 2, "column": 6 } - } - }, - { - "type": "Identifier", - "value": "b", + }, "range": [ 17, 18 ], + "value": "b" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 6 + "column": 8 }, - "end": { + "start": { "line": 2, "column": 7 } - } - }, - { - "type": "Punctuator", - "value": "|", + }, "range": [ 18, 19 ], + "value": "|" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 7 + "column": 9 }, - "end": { + "start": { "line": 2, "column": 8 } - } - }, - { - "type": "Identifier", - "value": "c", + }, "range": [ 19, 20 ], + "value": "c" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 8 + "column": 10 }, - "end": { + "start": { "line": 2, "column": 9 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 20, 21 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 9 + "column": 11 }, - "end": { + "start": { "line": 2, "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 21, 22 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 10 + "column": 12 }, - "end": { + "start": { "line": 2, "column": 11 } - } - }, - { - "type": "Identifier", - "value": "d", + }, "range": [ 22, 23 ], + "value": "d" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 11 + "column": 13 }, - "end": { + "start": { "line": 2, "column": 12 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 23, 24 ], - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } - } + "value": ")" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/ast/parser-option-multiple-parsers-1/services.json b/test/fixtures/ast/parser-option-multiple-parsers-1/services.json index 7159ba5a..7f661a33 100644 --- a/test/fixtures/ast/parser-option-multiple-parsers-1/services.json +++ b/test/fixtures/ast/parser-option-multiple-parsers-1/services.json @@ -2,10 +2,12 @@ "defineCustomBlocksVisitor", "defineDocumentVisitor", "defineTemplateBodyVisitor", + "emitDecoratorMetadata", "esTreeNodeToTSNodeMap", + "experimentalDecorators", "getDocumentFragment", "getTemplateBodyTokenStore", - "hasFullTypeInformation", + "isolatedDeclarations", "program", "tsNodeToESTreeNodeMap" ] \ No newline at end of file diff --git a/test/fixtures/ast/parser-option-multiple-parsers-3/ast.json b/test/fixtures/ast/parser-option-multiple-parsers-3/ast.json index b3dadbb8..83f26de3 100644 --- a/test/fixtures/ast/parser-option-multiple-parsers-3/ast.json +++ b/test/fixtures/ast/parser-option-multiple-parsers-3/ast.json @@ -1,64 +1,58 @@ { "type": "Program", + "range": [ + 60, + 70 + ], "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "a", - "range": [ - 60, - 61 - ], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - } - }, "arguments": [ { "type": "Identifier", + "decorators": [], "name": "d", + "optional": false, "range": [ 67, 68 ], "loc": { - "start": { - "line": 5, - "column": 9 - }, "end": { "line": 5, "column": 10 + }, + "start": { + "line": 5, + "column": 9 } } } ], - "optional": false, - "range": [ - 60, - 69 - ], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 11 + "callee": { + "type": "Identifier", + "decorators": [], + "name": "a", + "optional": false, + "range": [ + 60, + 61 + ], + "loc": { + "end": { + "line": 5, + "column": 3 + }, + "start": { + "line": 5, + "column": 2 + } } }, - "typeParameters": { + "optional": false, + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 61, @@ -72,19 +66,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "b", + "optional": false, "range": [ 62, 63 ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 4 } } }, @@ -93,13 +89,13 @@ 63 ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 4 } } }, @@ -107,19 +103,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "c", + "optional": false, "range": [ 64, 65 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -128,13 +126,13 @@ 65 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } } @@ -144,27 +142,41 @@ 65 ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 4 } } } ], "loc": { - "start": { - "line": 5, - "column": 3 - }, "end": { "line": 5, "column": 8 + }, + "start": { + "line": 5, + "column": 3 } } + }, + "range": [ + 60, + 69 + ], + "loc": { + "end": { + "line": 5, + "column": 11 + }, + "start": { + "line": 5, + "column": 2 + } } }, "range": [ @@ -172,32 +184,19 @@ 69 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 11 + }, + "start": { + "line": 5, + "column": 2 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 60, - 70 - ], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 6, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -219,165 +218,165 @@ }, { "type": "Identifier", - "value": "a", + "loc": { + "end": { + "line": 5, + "column": 3 + }, + "start": { + "line": 5, + "column": 2 + } + }, "range": [ 60, 61 ], + "value": "a" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 2 + "column": 4 }, - "end": { + "start": { "line": 5, "column": 3 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 61, 62 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 3 + "column": 5 }, - "end": { + "start": { "line": 5, "column": 4 } - } - }, - { - "type": "Identifier", - "value": "b", + }, "range": [ 62, 63 ], + "value": "b" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 4 + "column": 6 }, - "end": { + "start": { "line": 5, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "|", + }, "range": [ 63, 64 ], + "value": "|" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 5 + "column": 7 }, - "end": { + "start": { "line": 5, "column": 6 } - } - }, - { - "type": "Identifier", - "value": "c", + }, "range": [ 64, 65 ], + "value": "c" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 6 + "column": 8 }, - "end": { + "start": { "line": 5, "column": 7 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 65, 66 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 7 + "column": 9 }, - "end": { + "start": { "line": 5, "column": 8 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 66, 67 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 8 + "column": 10 }, - "end": { + "start": { "line": 5, "column": 9 } - } - }, - { - "type": "Identifier", - "value": "d", + }, "range": [ 67, 68 ], + "value": "d" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 9 + "column": 11 }, - "end": { + "start": { "line": 5, "column": 10 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 68, 69 ], - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 11 - } - } + "value": ")" }, { "type": "Punctuator", @@ -398,7 +397,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 6, + "column": 0 + }, + "start": { + "line": 5, + "column": 2 + } + }, "templateBody": { "type": "VElement", "range": [ diff --git a/test/fixtures/ast/parser-option-multiple-parsers-3/services.json b/test/fixtures/ast/parser-option-multiple-parsers-3/services.json index 7159ba5a..7f661a33 100644 --- a/test/fixtures/ast/parser-option-multiple-parsers-3/services.json +++ b/test/fixtures/ast/parser-option-multiple-parsers-3/services.json @@ -2,10 +2,12 @@ "defineCustomBlocksVisitor", "defineDocumentVisitor", "defineTemplateBodyVisitor", + "emitDecoratorMetadata", "esTreeNodeToTSNodeMap", + "experimentalDecorators", "getDocumentFragment", "getTemplateBodyTokenStore", - "hasFullTypeInformation", + "isolatedDeclarations", "program", "tsNodeToESTreeNodeMap" ] \ No newline at end of file diff --git a/test/fixtures/ast/parser-option-multiple-parsers-without-script/ast.json b/test/fixtures/ast/parser-option-multiple-parsers-without-script/ast.json index 8ad44185..bfb9997e 100644 --- a/test/fixtures/ast/parser-option-multiple-parsers-without-script/ast.json +++ b/test/fixtures/ast/parser-option-multiple-parsers-without-script/ast.json @@ -1,23 +1,23 @@ { "type": "Program", - "body": [], - "sourceType": "module", "range": [ 0, 0 ], + "body": [], + "comments": [], + "sourceType": "module", + "tokens": [], "loc": { - "start": { - "line": 1, - "column": 0 - }, "end": { - "line": 1, - "column": 0 + "column": 0, + "line": 1 + }, + "start": { + "column": 0, + "line": 1 } }, - "tokens": [], - "comments": [], "templateBody": { "type": "VElement", "range": [ @@ -93,60 +93,50 @@ }, "expression": { "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "a", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - } - }, "arguments": [ { "type": "Identifier", + "decorators": [], "name": "d", + "optional": false, "range": [ 22, 23 ], "loc": { - "start": { - "line": 2, - "column": 11 - }, "end": { "line": 2, "column": 12 + }, + "start": { + "line": 2, + "column": 11 } } } ], - "optional": false, - "range": [ - 15, - 24 - ], - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 13 + "callee": { + "type": "Identifier", + "decorators": [], + "name": "a", + "optional": false, + "range": [ + 15, + 16 + ], + "loc": { + "end": { + "line": 2, + "column": 5 + }, + "start": { + "line": 2, + "column": 4 + } } }, - "typeParameters": { + "optional": false, + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 16, @@ -160,19 +150,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "b", + "optional": false, "range": [ 17, 18 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 7 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -181,13 +173,13 @@ 18 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 7 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -195,19 +187,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "c", + "optional": false, "range": [ 19, 20 ], "loc": { - "start": { - "line": 2, - "column": 8 - }, "end": { "line": 2, "column": 9 + }, + "start": { + "line": 2, + "column": 8 } } }, @@ -216,13 +210,13 @@ 20 ], "loc": { - "start": { - "line": 2, - "column": 8 - }, "end": { "line": 2, "column": 9 + }, + "start": { + "line": 2, + "column": 8 } } } @@ -232,46 +226,62 @@ 20 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 9 + }, + "start": { + "line": 2, + "column": 6 } } } ], "loc": { - "start": { - "line": 2, - "column": 5 - }, "end": { "line": 2, "column": 10 + }, + "start": { + "line": 2, + "column": 5 } } + }, + "range": [ + 15, + 24 + ], + "loc": { + "end": { + "line": 2, + "column": 13 + }, + "start": { + "line": 2, + "column": 4 + } } }, "references": [ { "id": { "type": "Identifier", + "decorators": [], "name": "a", + "optional": false, "range": [ 15, 16 ], "loc": { - "start": { - "line": 2, - "column": 4 - }, "end": { "line": 2, "column": 5 + }, + "start": { + "line": 2, + "column": 4 } } }, @@ -282,19 +292,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "d", + "optional": false, "range": [ 22, 23 ], "loc": { - "start": { - "line": 2, - "column": 11 - }, "end": { "line": 2, "column": 12 + }, + "start": { + "line": 2, + "column": 11 } } }, @@ -305,19 +317,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "b", + "optional": false, "range": [ 17, 18 ], "loc": { - "start": { - "line": 2, - "column": 6 - }, "end": { "line": 2, "column": 7 + }, + "start": { + "line": 2, + "column": 6 } } }, @@ -328,19 +342,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "c", + "optional": false, "range": [ 19, 20 ], "loc": { - "start": { - "line": 2, - "column": 8 - }, "end": { "line": 2, "column": 9 + }, + "start": { + "line": 2, + "column": 8 } } }, @@ -462,165 +478,165 @@ }, { "type": "Identifier", - "value": "a", + "loc": { + "end": { + "line": 2, + "column": 5 + }, + "start": { + "line": 2, + "column": 4 + } + }, "range": [ 15, 16 ], + "value": "a" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 4 + "column": 6 }, - "end": { + "start": { "line": 2, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 16, 17 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 5 + "column": 7 }, - "end": { + "start": { "line": 2, "column": 6 } - } - }, - { - "type": "Identifier", - "value": "b", + }, "range": [ 17, 18 ], + "value": "b" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 6 + "column": 8 }, - "end": { + "start": { "line": 2, "column": 7 } - } - }, - { - "type": "Punctuator", - "value": "|", + }, "range": [ 18, 19 ], + "value": "|" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 7 + "column": 9 }, - "end": { + "start": { "line": 2, "column": 8 } - } - }, - { - "type": "Identifier", - "value": "c", + }, "range": [ 19, 20 ], + "value": "c" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 8 + "column": 10 }, - "end": { + "start": { "line": 2, "column": 9 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 20, 21 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 9 + "column": 11 }, - "end": { + "start": { "line": 2, "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 21, 22 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 10 + "column": 12 }, - "end": { + "start": { "line": 2, "column": 11 } - } - }, - { - "type": "Identifier", - "value": "d", + }, "range": [ 22, 23 ], + "value": "d" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 11 + "column": 13 }, - "end": { + "start": { "line": 2, "column": 12 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 23, 24 ], - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } - } + "value": ")" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/ast/parser-option-multiple-parsers-without-script/services.json b/test/fixtures/ast/parser-option-multiple-parsers-without-script/services.json index 7159ba5a..7f661a33 100644 --- a/test/fixtures/ast/parser-option-multiple-parsers-without-script/services.json +++ b/test/fixtures/ast/parser-option-multiple-parsers-without-script/services.json @@ -2,10 +2,12 @@ "defineCustomBlocksVisitor", "defineDocumentVisitor", "defineTemplateBodyVisitor", + "emitDecoratorMetadata", "esTreeNodeToTSNodeMap", + "experimentalDecorators", "getDocumentFragment", "getTemplateBodyTokenStore", - "hasFullTypeInformation", + "isolatedDeclarations", "program", "tsNodeToESTreeNodeMap" ] \ No newline at end of file diff --git a/test/fixtures/ast/pug/ast.json b/test/fixtures/ast/pug/ast.json index 0905cb4d..a10daf83 100644 --- a/test/fixtures/ast/pug/ast.json +++ b/test/fixtures/ast/pug/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [] } \ No newline at end of file diff --git a/test/fixtures/ast/raw-names/ast.json b/test/fixtures/ast/raw-names/ast.json index de79e673..c8a2e087 100644 --- a/test/fixtures/ast/raw-names/ast.json +++ b/test/fixtures/ast/raw-names/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/rawtext/ast.json b/test/fixtures/ast/rawtext/ast.json index 290dd4ec..d0eea386 100644 --- a/test/fixtures/ast/rawtext/ast.json +++ b/test/fixtures/ast/rawtext/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/script-setup-example01/ast.json b/test/fixtures/ast/script-setup-example01/ast.json index e4d8d462..d9adadbf 100644 --- a/test/fixtures/ast/script-setup-example01/ast.json +++ b/test/fixtures/ast/script-setup-example01/ast.json @@ -96,7 +96,8 @@ ], "value": "./Foo.vue", "raw": "'./Foo.vue'" - } + }, + "attributes": [] }, { "type": "ImportDeclaration", @@ -197,7 +198,8 @@ ], "value": "vue", "raw": "'vue'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", diff --git a/test/fixtures/ast/script-setup-example05/ast.json b/test/fixtures/ast/script-setup-example05/ast.json index d179c1df..a187f101 100644 --- a/test/fixtures/ast/script-setup-example05/ast.json +++ b/test/fixtures/ast/script-setup-example05/ast.json @@ -96,7 +96,8 @@ ], "value": "./Foo.vue", "raw": "'./Foo.vue'" - } + }, + "attributes": [] }, { "type": "ImportDeclaration", @@ -177,7 +178,8 @@ ], "value": "./MyComponent.vue", "raw": "'./MyComponent.vue'" - } + }, + "attributes": [] } ], "sourceType": "module", diff --git a/test/fixtures/ast/script-setup-example06/ast.json b/test/fixtures/ast/script-setup-example06/ast.json index 9b8daba2..e07644fb 100644 --- a/test/fixtures/ast/script-setup-example06/ast.json +++ b/test/fixtures/ast/script-setup-example06/ast.json @@ -96,7 +96,8 @@ ], "value": "./Foo.vue", "raw": "'./Foo.vue'" - } + }, + "attributes": [] }, { "type": "ImportDeclaration", @@ -177,7 +178,8 @@ ], "value": "./Bar.vue", "raw": "'./Bar.vue'" - } + }, + "attributes": [] } ], "sourceType": "module", diff --git a/test/fixtures/ast/script-setup-example07/ast.json b/test/fixtures/ast/script-setup-example07/ast.json index 46ad7ed6..1f16bdb6 100644 --- a/test/fixtures/ast/script-setup-example07/ast.json +++ b/test/fixtures/ast/script-setup-example07/ast.json @@ -116,7 +116,8 @@ ], "value": "v-click-outside", "raw": "'v-click-outside'" - } + }, + "attributes": [] } ], "sourceType": "module", diff --git a/test/fixtures/ast/script-setup-example09/ast.json b/test/fixtures/ast/script-setup-example09/ast.json index 8cc45989..02ac7838 100644 --- a/test/fixtures/ast/script-setup-example09/ast.json +++ b/test/fixtures/ast/script-setup-example09/ast.json @@ -175,7 +175,8 @@ ], "value": "vue", "raw": "'vue'" - } + }, + "attributes": [] }, { "type": "VariableDeclaration", diff --git a/test/fixtures/ast/self-closing-elements/ast.json b/test/fixtures/ast/self-closing-elements/ast.json index ff1cbfb7..68aecb41 100644 --- a/test/fixtures/ast/self-closing-elements/ast.json +++ b/test/fixtures/ast/self-closing-elements/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/slot-scope-default/ast.json b/test/fixtures/ast/slot-scope-default/ast.json index cb985254..1dadf2d4 100644 --- a/test/fixtures/ast/slot-scope-default/ast.json +++ b/test/fixtures/ast/slot-scope-default/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/slot-scope-destructuring/ast.json b/test/fixtures/ast/slot-scope-destructuring/ast.json index b7360160..bc1794e2 100644 --- a/test/fixtures/ast/slot-scope-destructuring/ast.json +++ b/test/fixtures/ast/slot-scope-destructuring/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/slot-scope-multi-parameters/ast.json b/test/fixtures/ast/slot-scope-multi-parameters/ast.json index 4fe53628..a34a8fca 100644 --- a/test/fixtures/ast/slot-scope-multi-parameters/ast.json +++ b/test/fixtures/ast/slot-scope-multi-parameters/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/slot-scope-rest-parameter/ast.json b/test/fixtures/ast/slot-scope-rest-parameter/ast.json index 9a9e0e0e..9a2ed552 100644 --- a/test/fixtures/ast/slot-scope-rest-parameter/ast.json +++ b/test/fixtures/ast/slot-scope-rest-parameter/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/slot-scope/ast.json b/test/fixtures/ast/slot-scope/ast.json index c888fc67..ecf8d2f1 100644 --- a/test/fixtures/ast/slot-scope/ast.json +++ b/test/fixtures/ast/slot-scope/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/svg-attrs-camel-case/ast.json b/test/fixtures/ast/svg-attrs-camel-case/ast.json index 1e3a6aa0..3a3a3927 100644 --- a/test/fixtures/ast/svg-attrs-camel-case/ast.json +++ b/test/fixtures/ast/svg-attrs-camel-case/ast.json @@ -138,7 +138,7 @@ } } ], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [ { diff --git a/test/fixtures/ast/svg-attrs-colon/ast.json b/test/fixtures/ast/svg-attrs-colon/ast.json index b5a4c622..46367cd4 100644 --- a/test/fixtures/ast/svg-attrs-colon/ast.json +++ b/test/fixtures/ast/svg-attrs-colon/ast.json @@ -138,7 +138,7 @@ } } ], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [ { diff --git a/test/fixtures/ast/svg-namespace/ast.json b/test/fixtures/ast/svg-namespace/ast.json index 68f9c796..ce6d4e1b 100644 --- a/test/fixtures/ast/svg-namespace/ast.json +++ b/test/fixtures/ast/svg-namespace/ast.json @@ -138,7 +138,7 @@ } } ], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [ { diff --git a/test/fixtures/ast/svg-upper/ast.json b/test/fixtures/ast/svg-upper/ast.json index 24ac6fb7..26e58850 100644 --- a/test/fixtures/ast/svg-upper/ast.json +++ b/test/fixtures/ast/svg-upper/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/table/ast.json b/test/fixtures/ast/table/ast.json index 5baa64c5..f0488a41 100644 --- a/test/fixtures/ast/table/ast.json +++ b/test/fixtures/ast/table/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/text-and-expression-container/ast.json b/test/fixtures/ast/text-and-expression-container/ast.json index 3983af11..233bcc06 100644 --- a/test/fixtures/ast/text-and-expression-container/ast.json +++ b/test/fixtures/ast/text-and-expression-container/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/text/ast.json b/test/fixtures/ast/text/ast.json index ffb6c8b5..d529f26e 100644 --- a/test/fixtures/ast/text/ast.json +++ b/test/fixtures/ast/text/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/textarea/ast.json b/test/fixtures/ast/textarea/ast.json index 8e1cd026..793c9979 100644 --- a/test/fixtures/ast/textarea/ast.json +++ b/test/fixtures/ast/textarea/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json index 6d83d037..5f70958e 100644 --- a/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json +++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json @@ -1,21 +1,12 @@ { "type": "Program", - "body": [], - "sourceType": "module", "range": [ 116, 116 ], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 0 - } - }, + "body": [], + "comments": [], + "sourceType": "module", "tokens": [ { "type": "Punctuator", @@ -54,7 +45,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 8, + "column": 0 + }, + "start": { + "line": 8, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -187,120 +187,68 @@ }, "expression": { "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "JSON", - "range": [ - 32, - 36 - ], - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 15 - } - } - }, - "property": { - "type": "Identifier", - "name": "stringify", - "range": [ - 37, - 46 - ], - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 25 - } - } - }, - "computed": false, - "optional": false, - "range": [ - 32, - 46 - ], - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 25 - } - } - }, "arguments": [ { "type": "ObjectExpression", "properties": [ { "type": "Property", + "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "test", + "optional": false, "range": [ 49, 53 ], "loc": { - "start": { - "line": 3, - "column": 28 - }, "end": { "line": 3, "column": 32 + }, + "start": { + "line": 3, + "column": 28 } } }, + "kind": "init", + "method": false, + "optional": false, + "shorthand": false, "value": { "type": "Literal", - "value": "test", "raw": "'test'", + "value": "test", "range": [ 55, 61 ], "loc": { - "start": { - "line": 3, - "column": 34 - }, "end": { "line": 3, "column": 40 + }, + "start": { + "line": 3, + "column": 34 } } }, - "computed": false, - "method": false, - "shorthand": false, - "kind": "init", "range": [ 49, 61 ], "loc": { - "start": { - "line": 3, - "column": 28 - }, "end": { "line": 3, "column": 40 + }, + "start": { + "line": 3, + "column": 28 } } } @@ -310,30 +258,89 @@ 62 ], "loc": { + "end": { + "line": 3, + "column": 41 + }, "start": { "line": 3, "column": 26 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "decorators": [], + "name": "JSON", + "optional": false, + "range": [ + 32, + 36 + ], + "loc": { + "end": { + "line": 3, + "column": 15 }, + "start": { + "line": 3, + "column": 11 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "decorators": [], + "name": "stringify", + "optional": false, + "range": [ + 37, + 46 + ], + "loc": { "end": { "line": 3, - "column": 41 + "column": 25 + }, + "start": { + "line": 3, + "column": 16 } } + }, + "range": [ + 32, + 46 + ], + "loc": { + "end": { + "line": 3, + "column": 25 + }, + "start": { + "line": 3, + "column": 11 + } } - ], + }, "optional": false, "range": [ 32, 63 ], "loc": { - "start": { - "line": 3, - "column": 11 - }, "end": { "line": 3, "column": 42 + }, + "start": { + "line": 3, + "column": 11 } } }, @@ -341,19 +348,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "JSON", + "optional": false, "range": [ 32, 36 ], "loc": { - "start": { - "line": 3, - "column": 11 - }, "end": { "line": 3, "column": 15 + }, + "start": { + "line": 3, + "column": 11 } } }, @@ -567,183 +576,183 @@ }, { "type": "Identifier", - "value": "JSON", + "loc": { + "end": { + "line": 3, + "column": 15 + }, + "start": { + "line": 3, + "column": 11 + } + }, "range": [ 32, 36 ], + "value": "JSON" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 11 + "column": 16 }, - "end": { + "start": { "line": 3, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 36, 37 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 15 + "column": 25 }, - "end": { + "start": { "line": 3, "column": 16 } - } - }, - { - "type": "Identifier", - "value": "stringify", + }, "range": [ 37, 46 ], + "value": "stringify" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 16 + "column": 26 }, - "end": { + "start": { "line": 3, "column": 25 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 46, 47 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 25 + "column": 27 }, - "end": { + "start": { "line": 3, "column": 26 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 47, 48 ], + "value": "{" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 26 + "column": 32 }, - "end": { + "start": { "line": 3, - "column": 27 + "column": 28 } - } - }, - { - "type": "Identifier", - "value": "test", + }, "range": [ 49, 53 ], + "value": "test" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 28 + "column": 33 }, - "end": { + "start": { "line": 3, "column": 32 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 53, 54 ], + "value": ":" + }, + { + "type": "String", "loc": { - "start": { + "end": { "line": 3, - "column": 32 + "column": 40 }, - "end": { + "start": { "line": 3, - "column": 33 + "column": 34 } - } - }, - { - "type": "String", - "value": "'test'", + }, "range": [ 55, 61 ], + "value": "'test'" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 34 + "column": 41 }, - "end": { + "start": { "line": 3, "column": 40 } - } - }, - { - "type": "Punctuator", - "value": "}", + }, "range": [ 61, 62 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 40 + "column": 42 }, - "end": { + "start": { "line": 3, "column": 41 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 62, 63 ], - "loc": { - "start": { - "line": 3, - "column": 41 - }, - "end": { - "line": 3, - "column": 42 - } - } + "value": ")" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json index d82fa33c..8bc27170 100644 --- a/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json +++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json @@ -2,13 +2,19 @@ "type": "global", "variables": [ { - "name": "ClassMemberDecoratorContext", + "name": "ClassAccessorDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "DecoratorContext", + "name": "ClassAccessorDecoratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorTarget", "identifiers": [], "defs": [], "references": [] @@ -20,7 +26,7 @@ "references": [] }, { - "name": "ClassMethodDecoratorContext", + "name": "ClassFieldDecoratorContext", "identifiers": [], "defs": [], "references": [] @@ -32,43 +38,43 @@ "references": [] }, { - "name": "ClassSetterDecoratorContext", + "name": "ClassMemberDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorContext", + "name": "ClassMethodDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorTarget", + "name": "ClassSetterDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorResult", + "name": "DecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassFieldDecoratorContext", + "name": "DecoratorMetadata", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassDecorator", + "name": "DecoratorMetadataObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDecorator", + "name": "ClassDecorator", "identifiers": [], "defs": [], "references": [] @@ -86,265 +92,271 @@ "references": [] }, { - "name": "Symbol", + "name": "PropertyDecorator", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyKey", + "name": "Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptor", + "name": "ArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptorMap", + "name": "ArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Object", + "name": "ArrayBufferLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "ObjectConstructor", + "name": "ArrayBufferTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Function", + "name": "ArrayBufferView", "identifiers": [], "defs": [], "references": [] }, { - "name": "FunctionConstructor", + "name": "ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisParameterType", + "name": "ArrayLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "OmitThisParameter", + "name": "Awaited", "identifiers": [], "defs": [], "references": [] }, { - "name": "CallableFunction", + "name": "Boolean", "identifiers": [], "defs": [], "references": [] }, { - "name": "NewableFunction", + "name": "BooleanConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IArguments", + "name": "CallableFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "String", + "name": "Capitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "StringConstructor", + "name": "ConcatArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Boolean", + "name": "ConstructorParameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "BooleanConstructor", + "name": "DataView", "identifiers": [], "defs": [], "references": [] }, { - "name": "Number", + "name": "DataViewConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NumberConstructor", + "name": "Date", "identifiers": [], "defs": [], "references": [] }, { - "name": "TemplateStringsArray", + "name": "DateConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportMeta", + "name": "Error", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportCallOptions", + "name": "ErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportAssertions", + "name": "EvalError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Math", + "name": "EvalErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Date", + "name": "Exclude", "identifiers": [], "defs": [], "references": [] }, { - "name": "DateConstructor", + "name": "Extract", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpMatchArray", + "name": "Float32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpExecArray", + "name": "Float32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExp", + "name": "Float64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpConstructor", + "name": "Float64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Error", + "name": "Function", "identifiers": [], "defs": [], "references": [] }, { - "name": "ErrorConstructor", + "name": "FunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalError", + "name": "IArguments", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalErrorConstructor", + "name": "ImportAssertions", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeError", + "name": "ImportAttributes", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeErrorConstructor", + "name": "ImportCallOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceError", + "name": "ImportMeta", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceErrorConstructor", + "name": "InstanceType", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxError", + "name": "Int8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxErrorConstructor", + "name": "Int8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeError", + "name": "Int16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeErrorConstructor", + "name": "Int16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIError", + "name": "Int32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIErrorConstructor", + "name": "Int32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Intl", "identifiers": [], "defs": [], "references": [] @@ -356,79 +368,79 @@ "references": [] }, { - "name": "ReadonlyArray", + "name": "Lowercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConcatArray", + "name": "Math", "identifiers": [], "defs": [], "references": [] }, { - "name": "Array", + "name": "NewableFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayConstructor", + "name": "NoInfer", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypedPropertyDescriptor", + "name": "NonNullable", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructorLike", + "name": "Number", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseLike", + "name": "NumberConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Promise", + "name": "Object", "identifiers": [], "defs": [], "references": [] }, { - "name": "Awaited", + "name": "ObjectConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayLike", + "name": "Omit", "identifiers": [], "defs": [], "references": [] }, { - "name": "Partial", + "name": "OmitThisParameter", "identifiers": [], "defs": [], "references": [] }, { - "name": "Required", + "name": "Parameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "Readonly", + "name": "Partial", "identifiers": [], "defs": [], "references": [] @@ -440,199 +452,217 @@ "references": [] }, { - "name": "Record", + "name": "Promise", "identifiers": [], "defs": [], "references": [] }, { - "name": "Exclude", + "name": "PromiseConstructorLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "Extract", + "name": "PromiseLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "Omit", + "name": "PropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NonNullable", + "name": "PropertyDescriptorMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Parameters", + "name": "PropertyKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConstructorParameters", + "name": "RangeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReturnType", + "name": "RangeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "InstanceType", + "name": "Readonly", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uppercase", + "name": "ReadonlyArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Lowercase", + "name": "Record", "identifiers": [], "defs": [], "references": [] }, { - "name": "Capitalize", + "name": "ReferenceError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uncapitalize", + "name": "ReferenceErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisType", + "name": "RegExp", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBuffer", + "name": "RegExpConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferTypes", + "name": "RegExpExecArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferLike", + "name": "RegExpMatchArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferConstructor", + "name": "Required", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferView", + "name": "ReturnType", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataView", + "name": "String", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataViewConstructor", + "name": "StringConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8Array", + "name": "Symbol", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8ArrayConstructor", + "name": "SyntaxError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8Array", + "name": "SyntaxErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ArrayConstructor", + "name": "TemplateStringsArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArray", + "name": "ThisParameterType", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArrayConstructor", + "name": "ThisType", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16Array", + "name": "TypedPropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16ArrayConstructor", + "name": "TypeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16Array", + "name": "TypeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16ArrayConstructor", + "name": "Uint8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32Array", + "name": "Uint8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32ArrayConstructor", + "name": "Uint8ClampedArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Uint8ClampedArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Uint16Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Uint16ArrayConstructor", "identifiers": [], "defs": [], "references": [] @@ -650,31 +680,37 @@ "references": [] }, { - "name": "Float32Array", + "name": "Uncapitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32ArrayConstructor", + "name": "Uppercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64Array", + "name": "URIError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64ArrayConstructor", + "name": "URIErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Intl", + "name": "WeakKey", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakKeyTypes", "identifiers": [], "defs": [], "references": [] @@ -698,31 +734,31 @@ "references": [] }, { - "name": "WeakMap", + "name": "ReadonlySet", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMapConstructor", + "name": "Set", "identifiers": [], "defs": [], "references": [] }, { - "name": "Set", + "name": "SetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SetConstructor", + "name": "WeakMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlySet", + "name": "WeakMapConstructor", "identifiers": [], "defs": [], "references": [] @@ -746,19 +782,25 @@ "references": [] }, { - "name": "IteratorYieldResult", + "name": "ArrayIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorReturnResult", + "name": "BuiltinIteratorReturn", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorResult", + "name": "Iterable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IterableIterator", "identifiers": [], "defs": [], "references": [] @@ -770,13 +812,31 @@ "references": [] }, { - "name": "Iterable", + "name": "IteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "IterableIterator", + "name": "IteratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorReturnResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorYieldResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "MapIterator", "identifiers": [], "defs": [], "references": [] @@ -787,6 +847,18 @@ "defs": [], "references": [] }, + { + "name": "SetIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "StringIterator", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "Generator", "identifiers": [], @@ -806,13 +878,13 @@ "references": [] }, { - "name": "ProxyHandler", + "name": "ProxyConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyConstructor", + "name": "ProxyHandler", "identifiers": [], "defs": [], "references": [] @@ -823,6 +895,12 @@ "defs": [], "references": [] }, + { + "name": "Atomics", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "SharedArrayBuffer", "identifiers": [], @@ -836,25 +914,25 @@ "references": [] }, { - "name": "Atomics", + "name": "AsyncIterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterator", + "name": "AsyncIterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterable", + "name": "AsyncIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterableIterator", + "name": "AsyncIteratorObject", "identifiers": [], "defs": [], "references": [] @@ -877,6 +955,192 @@ "defs": [], "references": [] }, + { + "name": "FlatArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigIntConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigIntToLocaleStringOptions", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigUint64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigUint64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseFulfilledResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseRejectedResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseSettledResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RegExpStringIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AggregateError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AggregateErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FinalizationRegistry", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FinalizationRegistryConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakRef", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakRefConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ErrorOptions", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RegExpIndicesArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseWithResolvers", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposableStack", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposableStackConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Disposable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DisposableStack", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DisposableStackConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SuppressedError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SuppressedErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ReadonlySetLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorObjectConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "const", "identifiers": [], diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/services.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/services.json index 7159ba5a..7f661a33 100644 --- a/test/fixtures/ast/ts-script-setup-with-use-global-var/services.json +++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/services.json @@ -2,10 +2,12 @@ "defineCustomBlocksVisitor", "defineDocumentVisitor", "defineTemplateBodyVisitor", + "emitDecoratorMetadata", "esTreeNodeToTSNodeMap", + "experimentalDecorators", "getDocumentFragment", "getTemplateBodyTokenStore", - "hasFullTypeInformation", + "isolatedDeclarations", "program", "tsNodeToESTreeNodeMap" ] \ No newline at end of file diff --git a/test/fixtures/ast/v-bind-prop-shorthand/ast.json b/test/fixtures/ast/v-bind-prop-shorthand/ast.json index ba515f2f..dc3c2610 100644 --- a/test/fixtures/ast/v-bind-prop-shorthand/ast.json +++ b/test/fixtures/ast/v-bind-prop-shorthand/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-bind-same-name-shorthand02-options/scope.json b/test/fixtures/ast/v-bind-same-name-shorthand02-options/scope.json index 19cca0f2..66d2c7f4 100644 --- a/test/fixtures/ast/v-bind-same-name-shorthand02-options/scope.json +++ b/test/fixtures/ast/v-bind-same-name-shorthand02-options/scope.json @@ -4,25 +4,17 @@ "references": [], "childScopes": [ { - "type": "module", - "variables": [], - "references": [], - "childScopes": [ + "type": "function", + "variables": [ { - "type": "function", - "variables": [ - { - "name": "arguments", - "identifiers": [], - "defs": [], - "references": [] - } - ], - "references": [], - "childScopes": [], - "through": [] + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] } ], + "references": [], + "childScopes": [], "through": [] } ], diff --git a/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/scope.json b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/scope.json index 19cca0f2..66d2c7f4 100644 --- a/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/scope.json +++ b/test/fixtures/ast/v-bind-same-name-shorthand04-with-v-for/scope.json @@ -4,25 +4,17 @@ "references": [], "childScopes": [ { - "type": "module", - "variables": [], - "references": [], - "childScopes": [ + "type": "function", + "variables": [ { - "type": "function", - "variables": [ - { - "name": "arguments", - "identifiers": [], - "defs": [], - "references": [] - } - ], - "references": [], - "childScopes": [], - "through": [] + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] } ], + "references": [], + "childScopes": [], "through": [] } ], diff --git a/test/fixtures/ast/v-bind-sequence-expression/ast.json b/test/fixtures/ast/v-bind-sequence-expression/ast.json index 79cbf7a3..34ebd90b 100644 --- a/test/fixtures/ast/v-bind-sequence-expression/ast.json +++ b/test/fixtures/ast/v-bind-sequence-expression/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-bind-spread-element/ast.json b/test/fixtures/ast/v-bind-spread-element/ast.json index 8600e444..ab827027 100644 --- a/test/fixtures/ast/v-bind-spread-element/ast.json +++ b/test/fixtures/ast/v-bind-spread-element/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-for-directives-error-with-es5/parser-options.json b/test/fixtures/ast/v-for-directives-error-with-es5/parser-options.json index fcc8a62f..03c6610d 100644 --- a/test/fixtures/ast/v-for-directives-error-with-es5/parser-options.json +++ b/test/fixtures/ast/v-for-directives-error-with-es5/parser-options.json @@ -1,3 +1,4 @@ { - "ecmaVersion": 5 + "ecmaVersion": 5, + "sourceType": "script" } diff --git a/test/fixtures/ast/v-for-directives-error/ast.json b/test/fixtures/ast/v-for-directives-error/ast.json index a79f66fa..9c9bf3fd 100644 --- a/test/fixtures/ast/v-for-directives-error/ast.json +++ b/test/fixtures/ast/v-for-directives-error/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-for-directives-index/ast.json b/test/fixtures/ast/v-for-directives-index/ast.json index 36768789..df5c82af 100644 --- a/test/fixtures/ast/v-for-directives-index/ast.json +++ b/test/fixtures/ast/v-for-directives-index/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-for-directives-with-destructuring/ast.json b/test/fixtures/ast/v-for-directives-with-destructuring/ast.json index 6e5ebe7d..ddf0f4c2 100644 --- a/test/fixtures/ast/v-for-directives-with-destructuring/ast.json +++ b/test/fixtures/ast/v-for-directives-with-destructuring/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-for-directives-with-es5-2/parser-options.json b/test/fixtures/ast/v-for-directives-with-es5-2/parser-options.json index fcc8a62f..03c6610d 100644 --- a/test/fixtures/ast/v-for-directives-with-es5-2/parser-options.json +++ b/test/fixtures/ast/v-for-directives-with-es5-2/parser-options.json @@ -1,3 +1,4 @@ { - "ecmaVersion": 5 + "ecmaVersion": 5, + "sourceType": "script" } diff --git a/test/fixtures/ast/v-for-directives-with-es5/parser-options.json b/test/fixtures/ast/v-for-directives-with-es5/parser-options.json index fcc8a62f..03c6610d 100644 --- a/test/fixtures/ast/v-for-directives-with-es5/parser-options.json +++ b/test/fixtures/ast/v-for-directives-with-es5/parser-options.json @@ -1,3 +1,4 @@ { - "ecmaVersion": 5 + "ecmaVersion": 5, + "sourceType": "script" } diff --git a/test/fixtures/ast/v-for-directives/ast.json b/test/fixtures/ast/v-for-directives/ast.json index 4672c8d4..eb74e84d 100644 --- a/test/fixtures/ast/v-for-directives/ast.json +++ b/test/fixtures/ast/v-for-directives/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-arrow-function-expression.1/ast.json b/test/fixtures/ast/v-on-arrow-function-expression.1/ast.json index 4ecfef08..e96836d7 100644 --- a/test/fixtures/ast/v-on-arrow-function-expression.1/ast.json +++ b/test/fixtures/ast/v-on-arrow-function-expression.1/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-arrow-function-expression.2/ast.json b/test/fixtures/ast/v-on-arrow-function-expression.2/ast.json index a4a43c5b..79b19281 100644 --- a/test/fixtures/ast/v-on-arrow-function-expression.2/ast.json +++ b/test/fixtures/ast/v-on-arrow-function-expression.2/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-async-arrow-function-expression/ast.json b/test/fixtures/ast/v-on-async-arrow-function-expression/ast.json index 17fa8149..76c9ea47 100644 --- a/test/fixtures/ast/v-on-async-arrow-function-expression/ast.json +++ b/test/fixtures/ast/v-on-async-arrow-function-expression/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-async-function-expression/ast.json b/test/fixtures/ast/v-on-async-function-expression/ast.json index 447b74bf..af3d12eb 100644 --- a/test/fixtures/ast/v-on-async-function-expression/ast.json +++ b/test/fixtures/ast/v-on-async-function-expression/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-function-expression/ast.json b/test/fixtures/ast/v-on-function-expression/ast.json index 24049e41..946439ac 100644 --- a/test/fixtures/ast/v-on-function-expression/ast.json +++ b/test/fixtures/ast/v-on-function-expression/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-multiple-statements/ast.json b/test/fixtures/ast/v-on-multiple-statements/ast.json index 03f0a0c4..9b285e71 100644 --- a/test/fixtures/ast/v-on-multiple-statements/ast.json +++ b/test/fixtures/ast/v-on-multiple-statements/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-object-expression/ast.json b/test/fixtures/ast/v-on-object-expression/ast.json index c8cbcb81..c6d4163a 100644 --- a/test/fixtures/ast/v-on-object-expression/ast.json +++ b/test/fixtures/ast/v-on-object-expression/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-simple-path.1/ast.json b/test/fixtures/ast/v-on-simple-path.1/ast.json index d580550e..8a1e525d 100644 --- a/test/fixtures/ast/v-on-simple-path.1/ast.json +++ b/test/fixtures/ast/v-on-simple-path.1/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-simple-path.2/ast.json b/test/fixtures/ast/v-on-simple-path.2/ast.json index 9f05e47b..71f7779c 100644 --- a/test/fixtures/ast/v-on-simple-path.2/ast.json +++ b/test/fixtures/ast/v-on-simple-path.2/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-simple-path.3/ast.json b/test/fixtures/ast/v-on-simple-path.3/ast.json index a9b40fae..1ac5a8d2 100644 --- a/test/fixtures/ast/v-on-simple-path.3/ast.json +++ b/test/fixtures/ast/v-on-simple-path.3/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-on-simple-path.4/ast.json b/test/fixtures/ast/v-on-simple-path.4/ast.json index 10bc3274..5dd52cb6 100644 --- a/test/fixtures/ast/v-on-simple-path.4/ast.json +++ b/test/fixtures/ast/v-on-simple-path.4/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-pre/ast.json b/test/fixtures/ast/v-pre/ast.json index baaa037c..04772d33 100644 --- a/test/fixtures/ast/v-pre/ast.json +++ b/test/fixtures/ast/v-pre/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-slot-default-shorthand/ast.json b/test/fixtures/ast/v-slot-default-shorthand/ast.json index c6ca641e..1298f1e8 100644 --- a/test/fixtures/ast/v-slot-default-shorthand/ast.json +++ b/test/fixtures/ast/v-slot-default-shorthand/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-slot-default/ast.json b/test/fixtures/ast/v-slot-default/ast.json index f1ce9aee..835b83b8 100644 --- a/test/fixtures/ast/v-slot-default/ast.json +++ b/test/fixtures/ast/v-slot-default/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-slot-named-shorthand/ast.json b/test/fixtures/ast/v-slot-named-shorthand/ast.json index 4a94e5d4..a6a99b82 100644 --- a/test/fixtures/ast/v-slot-named-shorthand/ast.json +++ b/test/fixtures/ast/v-slot-named-shorthand/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/v-slot-named/ast.json b/test/fixtures/ast/v-slot-named/ast.json index 60ab37e6..dcc9961d 100644 --- a/test/fixtures/ast/v-slot-named/ast.json +++ b/test/fixtures/ast/v-slot-named/ast.json @@ -17,7 +17,7 @@ 0 ], "body": [], - "sourceType": "script", + "sourceType": "module", "comments": [], "tokens": [], "templateBody": { diff --git a/test/fixtures/ast/vue3.3-generic-1/ast.json b/test/fixtures/ast/vue3.3-generic-1/ast.json index c00e934a..6c0f8f26 100644 --- a/test/fixtures/ast/vue3.3-generic-1/ast.json +++ b/test/fixtures/ast/vue3.3-generic-1/ast.json @@ -1,45 +1,37 @@ { "type": "Program", + "range": [ + 37, + 60 + ], "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", + "arguments": [], "callee": { "type": "Identifier", + "decorators": [], "name": "defineProps", + "optional": false, "range": [ 37, 48 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 11 + }, + "start": { + "line": 2, + "column": 0 } } }, - "arguments": [], "optional": false, - "range": [ - 37, - 59 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 48, @@ -54,32 +46,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 50, 53 ], "loc": { - "start": { - "line": 2, - "column": 13 - }, "end": { "line": 2, "column": 16 + }, + "start": { + "line": 2, + "column": 13 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 2, - "column": 16 - }, "end": { "line": 2, "column": 18 + }, + "start": { + "line": 2, + "column": 16 } }, "range": [ @@ -90,19 +87,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 54, 55 ], "loc": { - "start": { - "line": 2, - "column": 17 - }, "end": { "line": 2, "column": 18 + }, + "start": { + "line": 2, + "column": 17 } } }, @@ -111,13 +110,13 @@ 55 ], "loc": { - "start": { - "line": 2, - "column": 17 - }, "end": { "line": 2, "column": 18 + }, + "start": { + "line": 2, + "column": 17 } } } @@ -127,13 +126,13 @@ 55 ], "loc": { - "start": { - "line": 2, - "column": 13 - }, "end": { "line": 2, "column": 18 + }, + "start": { + "line": 2, + "column": 13 } } } @@ -143,27 +142,41 @@ 56 ], "loc": { - "start": { - "line": 2, - "column": 12 - }, "end": { "line": 2, "column": 19 + }, + "start": { + "line": 2, + "column": 12 } } } ], "loc": { - "start": { - "line": 2, - "column": 11 - }, "end": { "line": 2, "column": 20 + }, + "start": { + "line": 2, + "column": 11 } } + }, + "range": [ + 37, + 59 + ], + "loc": { + "end": { + "line": 2, + "column": 22 + }, + "start": { + "line": 2, + "column": 0 + } } }, "range": [ @@ -171,32 +184,19 @@ 59 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 22 + }, + "start": { + "line": 2, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 37, - 60 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 3, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -218,183 +218,183 @@ }, { "type": "Identifier", - "value": "defineProps", + "loc": { + "end": { + "line": 2, + "column": 11 + }, + "start": { + "line": 2, + "column": 0 + } + }, "range": [ 37, 48 ], + "value": "defineProps" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 0 + "column": 12 }, - "end": { + "start": { "line": 2, "column": 11 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 48, 49 ], + "value": "<" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 11 + "column": 13 }, - "end": { + "start": { "line": 2, "column": 12 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 49, 50 ], + "value": "{" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 2, "column": 13 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 50, 53 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 13 + "column": 17 }, - "end": { + "start": { "line": 2, "column": 16 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 53, 54 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 16 + "column": 18 }, - "end": { + "start": { "line": 2, "column": 17 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 54, 55 ], + "value": "T" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 17 + "column": 19 }, - "end": { + "start": { "line": 2, "column": 18 } - } - }, - { - "type": "Punctuator", - "value": "}", + }, "range": [ 55, 56 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 18 + "column": 20 }, - "end": { + "start": { "line": 2, "column": 19 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 56, 57 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 19 + "column": 21 }, - "end": { + "start": { "line": 2, "column": 20 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 57, 58 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 20 + "column": 22 }, - "end": { + "start": { "line": 2, "column": 21 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 58, 59 ], - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - } - } + "value": ")" }, { "type": "Punctuator", @@ -415,7 +415,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 3, + "column": 0 + }, + "start": { + "line": 2, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -491,19 +500,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 83, 86 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 2 } } }, @@ -511,19 +522,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 83, 86 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 2 } } }, @@ -717,21 +730,21 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 33, - 34 - ], "loc": { - "start": { - "line": 1, - "column": 33 - }, "end": { "line": 1, "column": 34 + }, + "start": { + "line": 1, + "column": 33 } - } + }, + "range": [ + 33, + 34 + ], + "value": "T" }, { "type": "Punctuator", @@ -951,21 +964,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 83, - 86 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 83, + 86 + ], + "value": "foo" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/ast/vue3.3-generic-1/scope.json b/test/fixtures/ast/vue3.3-generic-1/scope.json index f67735c2..62baf05d 100644 --- a/test/fixtures/ast/vue3.3-generic-1/scope.json +++ b/test/fixtures/ast/vue3.3-generic-1/scope.json @@ -2,13 +2,19 @@ "type": "global", "variables": [ { - "name": "ClassMemberDecoratorContext", + "name": "ClassAccessorDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "DecoratorContext", + "name": "ClassAccessorDecoratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorTarget", "identifiers": [], "defs": [], "references": [] @@ -20,7 +26,7 @@ "references": [] }, { - "name": "ClassMethodDecoratorContext", + "name": "ClassFieldDecoratorContext", "identifiers": [], "defs": [], "references": [] @@ -32,43 +38,43 @@ "references": [] }, { - "name": "ClassSetterDecoratorContext", + "name": "ClassMemberDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorContext", + "name": "ClassMethodDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorTarget", + "name": "ClassSetterDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorResult", + "name": "DecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassFieldDecoratorContext", + "name": "DecoratorMetadata", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassDecorator", + "name": "DecoratorMetadataObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDecorator", + "name": "ClassDecorator", "identifiers": [], "defs": [], "references": [] @@ -86,265 +92,271 @@ "references": [] }, { - "name": "Symbol", + "name": "PropertyDecorator", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyKey", + "name": "Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptor", + "name": "ArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptorMap", + "name": "ArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Object", + "name": "ArrayBufferLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "ObjectConstructor", + "name": "ArrayBufferTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Function", + "name": "ArrayBufferView", "identifiers": [], "defs": [], "references": [] }, { - "name": "FunctionConstructor", + "name": "ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisParameterType", + "name": "ArrayLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "OmitThisParameter", + "name": "Awaited", "identifiers": [], "defs": [], "references": [] }, { - "name": "CallableFunction", + "name": "Boolean", "identifiers": [], "defs": [], "references": [] }, { - "name": "NewableFunction", + "name": "BooleanConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IArguments", + "name": "CallableFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "String", + "name": "Capitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "StringConstructor", + "name": "ConcatArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Boolean", + "name": "ConstructorParameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "BooleanConstructor", + "name": "DataView", "identifiers": [], "defs": [], "references": [] }, { - "name": "Number", + "name": "DataViewConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NumberConstructor", + "name": "Date", "identifiers": [], "defs": [], "references": [] }, { - "name": "TemplateStringsArray", + "name": "DateConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportMeta", + "name": "Error", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportCallOptions", + "name": "ErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportAssertions", + "name": "EvalError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Math", + "name": "EvalErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Date", + "name": "Exclude", "identifiers": [], "defs": [], "references": [] }, { - "name": "DateConstructor", + "name": "Extract", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpMatchArray", + "name": "Float32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpExecArray", + "name": "Float32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExp", + "name": "Float64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpConstructor", + "name": "Float64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Error", + "name": "Function", "identifiers": [], "defs": [], "references": [] }, { - "name": "ErrorConstructor", + "name": "FunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalError", + "name": "IArguments", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalErrorConstructor", + "name": "ImportAssertions", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeError", + "name": "ImportAttributes", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeErrorConstructor", + "name": "ImportCallOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceError", + "name": "ImportMeta", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceErrorConstructor", + "name": "InstanceType", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxError", + "name": "Int8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxErrorConstructor", + "name": "Int8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeError", + "name": "Int16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeErrorConstructor", + "name": "Int16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIError", + "name": "Int32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIErrorConstructor", + "name": "Int32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Intl", "identifiers": [], "defs": [], "references": [] @@ -356,79 +368,79 @@ "references": [] }, { - "name": "ReadonlyArray", + "name": "Lowercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConcatArray", + "name": "Math", "identifiers": [], "defs": [], "references": [] }, { - "name": "Array", + "name": "NewableFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayConstructor", + "name": "NoInfer", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypedPropertyDescriptor", + "name": "NonNullable", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructorLike", + "name": "Number", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseLike", + "name": "NumberConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Promise", + "name": "Object", "identifiers": [], "defs": [], "references": [] }, { - "name": "Awaited", + "name": "ObjectConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayLike", + "name": "Omit", "identifiers": [], "defs": [], "references": [] }, { - "name": "Partial", + "name": "OmitThisParameter", "identifiers": [], "defs": [], "references": [] }, { - "name": "Required", + "name": "Parameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "Readonly", + "name": "Partial", "identifiers": [], "defs": [], "references": [] @@ -440,199 +452,217 @@ "references": [] }, { - "name": "Record", + "name": "Promise", "identifiers": [], "defs": [], "references": [] }, { - "name": "Exclude", + "name": "PromiseConstructorLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "Extract", + "name": "PromiseLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "Omit", + "name": "PropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NonNullable", + "name": "PropertyDescriptorMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Parameters", + "name": "PropertyKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConstructorParameters", + "name": "RangeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReturnType", + "name": "RangeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "InstanceType", + "name": "Readonly", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uppercase", + "name": "ReadonlyArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Lowercase", + "name": "Record", "identifiers": [], "defs": [], "references": [] }, { - "name": "Capitalize", + "name": "ReferenceError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uncapitalize", + "name": "ReferenceErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisType", + "name": "RegExp", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBuffer", + "name": "RegExpConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferTypes", + "name": "RegExpExecArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferLike", + "name": "RegExpMatchArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferConstructor", + "name": "Required", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferView", + "name": "ReturnType", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataView", + "name": "String", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataViewConstructor", + "name": "StringConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8Array", + "name": "Symbol", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8ArrayConstructor", + "name": "SyntaxError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8Array", + "name": "SyntaxErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ArrayConstructor", + "name": "TemplateStringsArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArray", + "name": "ThisParameterType", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArrayConstructor", + "name": "ThisType", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16Array", + "name": "TypedPropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16ArrayConstructor", + "name": "TypeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16Array", + "name": "TypeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16ArrayConstructor", + "name": "Uint8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32Array", + "name": "Uint8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32ArrayConstructor", + "name": "Uint8ClampedArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Uint8ClampedArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Uint16Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Uint16ArrayConstructor", "identifiers": [], "defs": [], "references": [] @@ -650,31 +680,37 @@ "references": [] }, { - "name": "Float32Array", + "name": "Uncapitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32ArrayConstructor", + "name": "Uppercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64Array", + "name": "URIError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64ArrayConstructor", + "name": "URIErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Intl", + "name": "WeakKey", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakKeyTypes", "identifiers": [], "defs": [], "references": [] @@ -698,31 +734,31 @@ "references": [] }, { - "name": "WeakMap", + "name": "ReadonlySet", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMapConstructor", + "name": "Set", "identifiers": [], "defs": [], "references": [] }, { - "name": "Set", + "name": "SetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SetConstructor", + "name": "WeakMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlySet", + "name": "WeakMapConstructor", "identifiers": [], "defs": [], "references": [] @@ -746,19 +782,25 @@ "references": [] }, { - "name": "IteratorYieldResult", + "name": "ArrayIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorReturnResult", + "name": "BuiltinIteratorReturn", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorResult", + "name": "Iterable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IterableIterator", "identifiers": [], "defs": [], "references": [] @@ -770,13 +812,31 @@ "references": [] }, { - "name": "Iterable", + "name": "IteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "IterableIterator", + "name": "IteratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorReturnResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorYieldResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "MapIterator", "identifiers": [], "defs": [], "references": [] @@ -787,6 +847,18 @@ "defs": [], "references": [] }, + { + "name": "SetIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "StringIterator", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "Generator", "identifiers": [], @@ -806,13 +878,13 @@ "references": [] }, { - "name": "ProxyHandler", + "name": "ProxyConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyConstructor", + "name": "ProxyHandler", "identifiers": [], "defs": [], "references": [] @@ -823,6 +895,12 @@ "defs": [], "references": [] }, + { + "name": "Atomics", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "SharedArrayBuffer", "identifiers": [], @@ -836,25 +914,25 @@ "references": [] }, { - "name": "Atomics", + "name": "AsyncIterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterator", + "name": "AsyncIterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterable", + "name": "AsyncIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterableIterator", + "name": "AsyncIteratorObject", "identifiers": [], "defs": [], "references": [] @@ -877,6 +955,192 @@ "defs": [], "references": [] }, + { + "name": "FlatArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigIntConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigIntToLocaleStringOptions", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigUint64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigUint64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseFulfilledResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseRejectedResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseSettledResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RegExpStringIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AggregateError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AggregateErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FinalizationRegistry", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FinalizationRegistryConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakRef", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakRefConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ErrorOptions", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RegExpIndicesArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseWithResolvers", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposableStack", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposableStackConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Disposable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DisposableStack", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DisposableStackConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SuppressedError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SuppressedErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ReadonlySetLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorObjectConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "const", "identifiers": [], @@ -893,13 +1157,13 @@ "type": "Identifier", "name": "defineProps", "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 11 + }, + "start": { + "line": 2, + "column": 0 } } }, @@ -918,13 +1182,13 @@ "type": "Identifier", "name": "T", "loc": { - "start": { - "line": 2, - "column": 17 - }, "end": { "line": 2, "column": 18 + }, + "start": { + "line": 2, + "column": 17 } } }, @@ -945,13 +1209,13 @@ "type": "Identifier", "name": "defineProps", "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 11 + }, + "start": { + "line": 2, + "column": 0 } } }, @@ -963,13 +1227,13 @@ "type": "Identifier", "name": "T", "loc": { - "start": { - "line": 2, - "column": 17 - }, "end": { "line": 2, "column": 18 + }, + "start": { + "line": 2, + "column": 17 } } }, @@ -984,13 +1248,13 @@ "type": "Identifier", "name": "defineProps", "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 11 + }, + "start": { + "line": 2, + "column": 0 } } }, @@ -1002,13 +1266,13 @@ "type": "Identifier", "name": "T", "loc": { - "start": { - "line": 2, - "column": 17 - }, "end": { "line": 2, "column": 18 + }, + "start": { + "line": 2, + "column": 17 } } }, diff --git a/test/fixtures/ast/vue3.3-generic-2/ast.json b/test/fixtures/ast/vue3.3-generic-2/ast.json index 3685710d..6eab96ca 100644 --- a/test/fixtures/ast/vue3.3-generic-2/ast.json +++ b/test/fixtures/ast/vue3.3-generic-2/ast.json @@ -1,23 +1,30 @@ { "type": "Program", + "range": [ + 9, + 162 + ], "body": [ { "type": "TSTypeAliasDeclaration", + "declare": false, "id": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 14, 17 ], "loc": { - "start": { - "line": 2, - "column": 5 - }, "end": { "line": 2, "column": 8 + }, + "start": { + "line": 2, + "column": 5 } } }, @@ -31,13 +38,13 @@ 26 ], "loc": { - "start": { - "line": 2, - "column": 11 - }, "end": { "line": 2, "column": 17 + }, + "start": { + "line": 2, + "column": 11 } } }, @@ -48,13 +55,13 @@ 35 ], "loc": { - "start": { - "line": 2, - "column": 20 - }, "end": { "line": 2, "column": 26 + }, + "start": { + "line": 2, + "column": 20 } } } @@ -64,13 +71,13 @@ 35 ], "loc": { - "start": { - "line": 2, - "column": 11 - }, "end": { "line": 2, "column": 26 + }, + "start": { + "line": 2, + "column": 11 } } }, @@ -79,13 +86,13 @@ 35 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 26 + }, + "start": { + "line": 2, + "column": 0 } } }, @@ -94,61 +101,52 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 101, 102 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, "init": { "type": "CallExpression", + "arguments": [], "callee": { "type": "Identifier", + "decorators": [], "name": "defineProps", + "optional": false, "range": [ 105, 116 ], "loc": { - "start": { - "line": 5, - "column": 10 - }, "end": { "line": 5, "column": 21 + }, + "start": { + "line": 5, + "column": 10 } } }, - "arguments": [], "optional": false, - "range": [ - 105, - 127 - ], - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 32 - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 116, @@ -163,32 +161,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 118, 121 ], "loc": { - "start": { - "line": 5, - "column": 23 - }, "end": { "line": 5, "column": 26 + }, + "start": { + "line": 5, + "column": 23 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 5, - "column": 26 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 26 } }, "range": [ @@ -199,19 +202,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 122, 123 ], "loc": { - "start": { - "line": 5, - "column": 27 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 27 } } }, @@ -220,13 +225,13 @@ 123 ], "loc": { - "start": { - "line": 5, - "column": 27 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 27 } } } @@ -236,13 +241,13 @@ 123 ], "loc": { - "start": { - "line": 5, - "column": 23 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 23 } } } @@ -252,27 +257,41 @@ 124 ], "loc": { - "start": { - "line": 5, - "column": 22 - }, "end": { "line": 5, "column": 29 + }, + "start": { + "line": 5, + "column": 22 } } } ], "loc": { - "start": { - "line": 5, - "column": 21 - }, "end": { "line": 5, "column": 30 + }, + "start": { + "line": 5, + "column": 21 } } + }, + "range": [ + 105, + 127 + ], + "loc": { + "end": { + "line": 5, + "column": 32 + }, + "start": { + "line": 5, + "column": 10 + } } }, "range": [ @@ -280,30 +299,31 @@ 127 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 32 + }, + "start": { + "line": 5, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 95, 127 ], "loc": { - "start": { - "line": 5, - "column": 0 - }, "end": { "line": 5, "column": 32 + }, + "start": { + "line": 5, + "column": 0 } } }, @@ -312,76 +332,83 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 134, 137 ], "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, "init": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 140, 141 ], "loc": { - "start": { - "line": 6, - "column": 12 - }, "end": { "line": 6, "column": 13 + }, + "start": { + "line": 6, + "column": 12 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 142, 145 ], "loc": { - "start": { - "line": 6, - "column": 14 - }, "end": { "line": 6, "column": 17 + }, + "start": { + "line": 6, + "column": 14 } } }, - "computed": false, - "optional": false, "range": [ 140, 145 ], "loc": { - "start": { - "line": 6, - "column": 12 - }, "end": { "line": 6, "column": 17 + }, + "start": { + "line": 6, + "column": 12 } } }, @@ -390,30 +417,31 @@ 145 ], "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 17 + }, + "start": { + "line": 6, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 128, 145 ], "loc": { - "start": { - "line": 6, - "column": 0 - }, "end": { "line": 6, "column": 17 + }, + "start": { + "line": 6, + "column": 0 } } }, @@ -421,94 +449,100 @@ "type": "ExpressionStatement", "expression": { "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "decorators": [], + "name": "foo", + "optional": false, + "range": [ + 158, + 161 + ], + "loc": { + "end": { + "line": 7, + "column": 15 + }, + "start": { + "line": 7, + "column": 12 + } + } + } + ], "callee": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "console", + "optional": false, "range": [ 146, 153 ], "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 7 + }, + "start": { + "line": 7, + "column": 0 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "log", + "optional": false, "range": [ 154, 157 ], "loc": { - "start": { - "line": 7, - "column": 8 - }, "end": { "line": 7, "column": 11 - } - } + }, + "start": { + "line": 7, + "column": 8 + } + } }, - "computed": false, - "optional": false, "range": [ 146, 157 ], "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 11 + }, + "start": { + "line": 7, + "column": 0 } } }, - "arguments": [ - { - "type": "Identifier", - "name": "foo", - "range": [ - 158, - 161 - ], - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 15 - } - } - } - ], "optional": false, "range": [ 146, 162 ], "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 16 + }, + "start": { + "line": 7, + "column": 0 } } }, @@ -517,32 +551,19 @@ 162 ], "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 16 + }, + "start": { + "line": 7, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 9, - 162 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 7, - "column": 16 - } - }, "tokens": [ { "type": "Punctuator", @@ -564,111 +585,111 @@ }, { "type": "Identifier", - "value": "type", + "loc": { + "end": { + "line": 2, + "column": 4 + }, + "start": { + "line": 2, + "column": 0 + } + }, "range": [ 9, 13 ], + "value": "type" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 0 + "column": 8 }, - "end": { + "start": { "line": 2, - "column": 4 + "column": 5 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 14, 17 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 5 + "column": 10 }, - "end": { + "start": { "line": 2, - "column": 8 + "column": 9 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 18, 19 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 9 + "column": 17 }, - "end": { + "start": { "line": 2, - "column": 10 + "column": 11 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 20, 26 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 11 + "column": 19 }, - "end": { + "start": { "line": 2, - "column": 17 + "column": 18 } - } - }, - { - "type": "Punctuator", - "value": "|", + }, "range": [ 27, 28 ], + "value": "|" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 18 + "column": 26 }, - "end": { + "start": { "line": 2, - "column": 19 + "column": 20 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 29, 35 ], - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 26 - } - } + "value": "string" }, { "type": "Punctuator", @@ -708,453 +729,453 @@ }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 5, + "column": 5 + }, + "start": { + "line": 5, + "column": 0 + } + }, "range": [ 95, 100 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 0 + "column": 7 }, - "end": { + "start": { "line": 5, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 101, 102 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 6 + "column": 9 }, - "end": { + "start": { "line": 5, - "column": 7 + "column": 8 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 103, 104 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 8 + "column": 21 }, - "end": { + "start": { "line": 5, - "column": 9 + "column": 10 } - } - }, - { - "type": "Identifier", - "value": "defineProps", + }, "range": [ 105, 116 ], + "value": "defineProps" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 10 + "column": 22 }, - "end": { + "start": { "line": 5, "column": 21 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 116, 117 ], + "value": "<" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 21 + "column": 23 }, - "end": { + "start": { "line": 5, "column": 22 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 117, 118 ], + "value": "{" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 22 + "column": 26 }, - "end": { + "start": { "line": 5, "column": 23 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 118, 121 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 23 + "column": 27 }, - "end": { + "start": { "line": 5, "column": 26 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 121, 122 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 26 + "column": 28 }, - "end": { + "start": { "line": 5, "column": 27 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 122, 123 ], + "value": "T" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 27 + "column": 29 }, - "end": { + "start": { "line": 5, "column": 28 } - } - }, - { - "type": "Punctuator", - "value": "}", + }, "range": [ 123, 124 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 28 + "column": 30 }, - "end": { + "start": { "line": 5, "column": 29 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 124, 125 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 29 + "column": 31 }, - "end": { + "start": { "line": 5, "column": 30 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 125, 126 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 30 + "column": 32 }, - "end": { + "start": { "line": 5, "column": 31 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 126, 127 ], - "loc": { - "start": { - "line": 5, - "column": 31 - }, - "end": { - "line": 5, - "column": 32 - } - } + "value": ")" }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 6, + "column": 5 + }, + "start": { + "line": 6, + "column": 0 + } + }, "range": [ 128, 133 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 6, - "column": 0 + "column": 9 }, - "end": { + "start": { "line": 6, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 134, 137 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 6, - "column": 6 + "column": 11 }, - "end": { + "start": { "line": 6, - "column": 9 + "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 138, 139 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 6, - "column": 10 + "column": 13 }, - "end": { + "start": { "line": 6, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 140, 141 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 6, - "column": 12 + "column": 14 }, - "end": { + "start": { "line": 6, "column": 13 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 141, 142 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 6, - "column": 13 + "column": 17 }, - "end": { + "start": { "line": 6, "column": 14 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 142, 145 ], - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 17 - } - } + "value": "foo" }, { "type": "Identifier", - "value": "console", + "loc": { + "end": { + "line": 7, + "column": 7 + }, + "start": { + "line": 7, + "column": 0 + } + }, "range": [ 146, 153 ], + "value": "console" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 0 + "column": 8 }, - "end": { + "start": { "line": 7, "column": 7 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 153, 154 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 7, - "column": 7 + "column": 11 }, - "end": { + "start": { "line": 7, "column": 8 } - } - }, - { - "type": "Identifier", - "value": "log", + }, "range": [ 154, 157 ], + "value": "log" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 8 + "column": 12 }, - "end": { + "start": { "line": 7, "column": 11 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 157, 158 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 7, - "column": 11 + "column": 15 }, - "end": { + "start": { "line": 7, "column": 12 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 158, 161 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 7, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 161, 162 ], - "loc": { - "start": { - "line": 7, - "column": 15 - }, - "end": { - "line": 7, - "column": 16 - } - } + "value": ")" }, { "type": "Punctuator", @@ -1175,7 +1196,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 7, + "column": 16 + }, + "start": { + "line": 2, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -1251,19 +1281,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 186, 189 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } } }, @@ -1271,19 +1303,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 186, 189 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } } }, @@ -1801,57 +1835,57 @@ }, { "type": "Identifier", - "value": "T", + "loc": { + "end": { + "line": 4, + "column": 34 + }, + "start": { + "line": 4, + "column": 33 + } + }, "range": [ 79, 80 ], + "value": "T" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 4, - "column": 33 + "column": 42 }, - "end": { + "start": { "line": 4, - "column": 34 + "column": 35 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 81, 88 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 35 + "column": 46 }, - "end": { + "start": { "line": 4, - "column": 42 + "column": 43 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 89, 92 ], - "loc": { - "start": { - "line": 4, - "column": 43 - }, - "end": { - "line": 4, - "column": 46 - } - } + "value": "Foo" }, { "type": "Punctuator", @@ -2359,21 +2393,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 186, - 189 - ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } - } + }, + "range": [ + 186, + 189 + ], + "value": "foo" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/ast/vue3.3-generic-2/scope.json b/test/fixtures/ast/vue3.3-generic-2/scope.json index 261ad368..1071159d 100644 --- a/test/fixtures/ast/vue3.3-generic-2/scope.json +++ b/test/fixtures/ast/vue3.3-generic-2/scope.json @@ -2,13 +2,19 @@ "type": "global", "variables": [ { - "name": "ClassMemberDecoratorContext", + "name": "ClassAccessorDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "DecoratorContext", + "name": "ClassAccessorDecoratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorTarget", "identifiers": [], "defs": [], "references": [] @@ -20,7 +26,7 @@ "references": [] }, { - "name": "ClassMethodDecoratorContext", + "name": "ClassFieldDecoratorContext", "identifiers": [], "defs": [], "references": [] @@ -32,43 +38,43 @@ "references": [] }, { - "name": "ClassSetterDecoratorContext", + "name": "ClassMemberDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorContext", + "name": "ClassMethodDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorTarget", + "name": "ClassSetterDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorResult", + "name": "DecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassFieldDecoratorContext", + "name": "DecoratorMetadata", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassDecorator", + "name": "DecoratorMetadataObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDecorator", + "name": "ClassDecorator", "identifiers": [], "defs": [], "references": [] @@ -86,265 +92,271 @@ "references": [] }, { - "name": "Symbol", + "name": "PropertyDecorator", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyKey", + "name": "Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptor", + "name": "ArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptorMap", + "name": "ArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Object", + "name": "ArrayBufferLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "ObjectConstructor", + "name": "ArrayBufferTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Function", + "name": "ArrayBufferView", "identifiers": [], "defs": [], "references": [] }, { - "name": "FunctionConstructor", + "name": "ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisParameterType", + "name": "ArrayLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "OmitThisParameter", + "name": "Awaited", "identifiers": [], "defs": [], "references": [] }, { - "name": "CallableFunction", + "name": "Boolean", "identifiers": [], "defs": [], "references": [] }, { - "name": "NewableFunction", + "name": "BooleanConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IArguments", + "name": "CallableFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "String", + "name": "Capitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "StringConstructor", + "name": "ConcatArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Boolean", + "name": "ConstructorParameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "BooleanConstructor", + "name": "DataView", "identifiers": [], "defs": [], "references": [] }, { - "name": "Number", + "name": "DataViewConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NumberConstructor", + "name": "Date", "identifiers": [], "defs": [], "references": [] }, { - "name": "TemplateStringsArray", + "name": "DateConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportMeta", + "name": "Error", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportCallOptions", + "name": "ErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportAssertions", + "name": "EvalError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Math", + "name": "EvalErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Date", + "name": "Exclude", "identifiers": [], "defs": [], "references": [] }, { - "name": "DateConstructor", + "name": "Extract", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpMatchArray", + "name": "Float32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpExecArray", + "name": "Float32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExp", + "name": "Float64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpConstructor", + "name": "Float64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Error", + "name": "Function", "identifiers": [], "defs": [], "references": [] }, { - "name": "ErrorConstructor", + "name": "FunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalError", + "name": "IArguments", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalErrorConstructor", + "name": "ImportAssertions", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeError", + "name": "ImportAttributes", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeErrorConstructor", + "name": "ImportCallOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceError", + "name": "ImportMeta", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceErrorConstructor", + "name": "InstanceType", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxError", + "name": "Int8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxErrorConstructor", + "name": "Int8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeError", + "name": "Int16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeErrorConstructor", + "name": "Int16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIError", + "name": "Int32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIErrorConstructor", + "name": "Int32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Intl", "identifiers": [], "defs": [], "references": [] @@ -356,79 +368,79 @@ "references": [] }, { - "name": "ReadonlyArray", + "name": "Lowercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConcatArray", + "name": "Math", "identifiers": [], "defs": [], "references": [] }, { - "name": "Array", + "name": "NewableFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayConstructor", + "name": "NoInfer", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypedPropertyDescriptor", + "name": "NonNullable", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructorLike", + "name": "Number", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseLike", + "name": "NumberConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Promise", + "name": "Object", "identifiers": [], "defs": [], "references": [] }, { - "name": "Awaited", + "name": "ObjectConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayLike", + "name": "Omit", "identifiers": [], "defs": [], "references": [] }, { - "name": "Partial", + "name": "OmitThisParameter", "identifiers": [], "defs": [], "references": [] }, { - "name": "Required", + "name": "Parameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "Readonly", + "name": "Partial", "identifiers": [], "defs": [], "references": [] @@ -440,283 +452,283 @@ "references": [] }, { - "name": "Record", + "name": "Promise", "identifiers": [], "defs": [], "references": [] }, { - "name": "Exclude", + "name": "PromiseConstructorLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "Extract", + "name": "PromiseLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "Omit", + "name": "PropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NonNullable", + "name": "PropertyDescriptorMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Parameters", + "name": "PropertyKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConstructorParameters", + "name": "RangeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReturnType", + "name": "RangeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "InstanceType", + "name": "Readonly", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uppercase", + "name": "ReadonlyArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Lowercase", + "name": "Record", "identifiers": [], "defs": [], "references": [] }, { - "name": "Capitalize", + "name": "ReferenceError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uncapitalize", + "name": "ReferenceErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisType", + "name": "RegExp", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBuffer", + "name": "RegExpConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferTypes", + "name": "RegExpExecArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferLike", + "name": "RegExpMatchArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferConstructor", + "name": "Required", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferView", + "name": "ReturnType", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataView", + "name": "String", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataViewConstructor", + "name": "StringConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8Array", + "name": "Symbol", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8ArrayConstructor", + "name": "SyntaxError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8Array", + "name": "SyntaxErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ArrayConstructor", + "name": "TemplateStringsArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArray", + "name": "ThisParameterType", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArrayConstructor", + "name": "ThisType", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16Array", + "name": "TypedPropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16ArrayConstructor", + "name": "TypeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16Array", + "name": "TypeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16ArrayConstructor", + "name": "Uint8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32Array", + "name": "Uint8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32ArrayConstructor", + "name": "Uint8ClampedArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32Array", + "name": "Uint8ClampedArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32ArrayConstructor", + "name": "Uint16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32Array", + "name": "Uint16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32ArrayConstructor", + "name": "Uint32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64Array", + "name": "Uint32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64ArrayConstructor", + "name": "Uncapitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "Intl", + "name": "Uppercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "Map", + "name": "URIError", "identifiers": [], "defs": [], "references": [] }, { - "name": "MapConstructor", + "name": "URIErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlyMap", + "name": "WeakKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMap", + "name": "WeakKeyTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMapConstructor", + "name": "Map", "identifiers": [], "defs": [], "references": [] }, { - "name": "Set", + "name": "MapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SetConstructor", + "name": "ReadonlyMap", "identifiers": [], "defs": [], "references": [] @@ -728,85 +740,139 @@ "references": [] }, { - "name": "WeakSet", + "name": "Set", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakSetConstructor", + "name": "SetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SymbolConstructor", + "name": "WeakMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorYieldResult", + "name": "WeakMapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorReturnResult", + "name": "WeakSet", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorResult", + "name": "WeakSetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterator", + "name": "SymbolConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterable", + "name": "ArrayIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "IterableIterator", + "name": "BuiltinIteratorReturn", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructor", + "name": "Iterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "Generator", + "name": "IterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunction", + "name": "Iterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunctionConstructor", + "name": "IteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyHandler", + "name": "IteratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorReturnResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorYieldResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "MapIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SetIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "StringIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Generator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "GeneratorFunction", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "GeneratorFunctionConstructor", "identifiers": [], "defs": [], "references": [] @@ -817,12 +883,24 @@ "defs": [], "references": [] }, + { + "name": "ProxyHandler", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "Reflect", "identifiers": [], "defs": [], "references": [] }, + { + "name": "Atomics", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "SharedArrayBuffer", "identifiers": [], @@ -836,25 +914,25 @@ "references": [] }, { - "name": "Atomics", + "name": "AsyncIterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterator", + "name": "AsyncIterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterable", + "name": "AsyncIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterableIterator", + "name": "AsyncIteratorObject", "identifiers": [], "defs": [], "references": [] @@ -877,6 +955,192 @@ "defs": [], "references": [] }, + { + "name": "FlatArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigIntConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigIntToLocaleStringOptions", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigUint64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigUint64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseFulfilledResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseRejectedResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseSettledResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RegExpStringIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AggregateError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AggregateErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FinalizationRegistry", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FinalizationRegistryConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakRef", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakRefConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ErrorOptions", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RegExpIndicesArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseWithResolvers", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposableStack", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposableStackConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Disposable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DisposableStack", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DisposableStackConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SuppressedError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SuppressedErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ReadonlySetLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorObjectConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "const", "identifiers": [], @@ -893,13 +1157,13 @@ "type": "Identifier", "name": "defineProps", "loc": { - "start": { - "line": 5, - "column": 10 - }, "end": { "line": 5, "column": 21 + }, + "start": { + "line": 5, + "column": 10 } } }, @@ -918,13 +1182,13 @@ "type": "Identifier", "name": "T", "loc": { - "start": { - "line": 5, - "column": 27 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 27 } } }, @@ -946,13 +1210,13 @@ "type": "Identifier", "name": "Foo", "loc": { - "start": { - "line": 2, - "column": 5 - }, "end": { "line": 2, "column": 8 + }, + "start": { + "line": 2, + "column": 5 } } } @@ -963,13 +1227,13 @@ "node": { "type": "TSTypeAliasDeclaration", "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 26 + }, + "start": { + "line": 2, + "column": 0 } } }, @@ -982,13 +1246,13 @@ "type": "Identifier", "name": "Foo", "loc": { - "start": { - "line": 2, - "column": 5 - }, "end": { "line": 2, "column": 8 + }, + "start": { + "line": 2, + "column": 5 } } }, @@ -997,13 +1261,13 @@ "type": "Identifier", "name": "Foo", "loc": { - "start": { - "line": 2, - "column": 5 - }, "end": { "line": 2, "column": 8 + }, + "start": { + "line": 2, + "column": 5 } } }, @@ -1019,13 +1283,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } } @@ -1036,13 +1300,13 @@ "node": { "type": "VariableDeclarator", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 32 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1055,13 +1319,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1070,13 +1334,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1087,13 +1351,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 6, - "column": 12 - }, "end": { "line": 6, "column": 13 + }, + "start": { + "line": 6, + "column": 12 } } }, @@ -1102,13 +1366,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1123,13 +1387,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } } @@ -1140,13 +1404,13 @@ "node": { "type": "VariableDeclarator", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 17 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1159,13 +1423,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1174,13 +1438,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1191,13 +1455,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 7, - "column": 12 - }, "end": { "line": 7, "column": 15 + }, + "start": { + "line": 7, + "column": 12 } } }, @@ -1206,13 +1470,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1223,13 +1487,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1238,13 +1502,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1260,13 +1524,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1275,13 +1539,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1292,13 +1556,13 @@ "type": "Identifier", "name": "defineProps", "loc": { - "start": { - "line": 5, - "column": 10 - }, "end": { "line": 5, "column": 21 + }, + "start": { + "line": 5, + "column": 10 } } }, @@ -1310,13 +1574,13 @@ "type": "Identifier", "name": "T", "loc": { - "start": { - "line": 5, - "column": 27 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 27 } } }, @@ -1328,13 +1592,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1343,13 +1607,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1360,13 +1624,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 6, - "column": 12 - }, "end": { "line": 6, "column": 13 + }, + "start": { + "line": 6, + "column": 12 } } }, @@ -1375,13 +1639,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1392,13 +1656,13 @@ "type": "Identifier", "name": "console", "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 7 + }, + "start": { + "line": 7, + "column": 0 } } }, @@ -1411,13 +1675,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 7, - "column": 12 - }, "end": { "line": 7, "column": 15 + }, + "start": { + "line": 7, + "column": 12 } } }, @@ -1426,13 +1690,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1446,13 +1710,13 @@ "type": "Identifier", "name": "defineProps", "loc": { - "start": { - "line": 5, - "column": 10 - }, "end": { "line": 5, "column": 21 + }, + "start": { + "line": 5, + "column": 10 } } }, @@ -1464,13 +1728,13 @@ "type": "Identifier", "name": "T", "loc": { - "start": { - "line": 5, - "column": 27 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 27 } } }, @@ -1482,13 +1746,13 @@ "type": "Identifier", "name": "console", "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 7 + }, + "start": { + "line": 7, + "column": 0 } } }, @@ -1505,13 +1769,13 @@ "type": "Identifier", "name": "console", "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 7 + }, + "start": { + "line": 7, + "column": 0 } } }, diff --git a/test/fixtures/ast/vue3.3-generic-3/ast.json b/test/fixtures/ast/vue3.3-generic-3/ast.json index 8dbd9da4..cb599c07 100644 --- a/test/fixtures/ast/vue3.3-generic-3/ast.json +++ b/test/fixtures/ast/vue3.3-generic-3/ast.json @@ -1,23 +1,30 @@ { "type": "Program", + "range": [ + 9, + 183 + ], "body": [ { "type": "TSTypeAliasDeclaration", + "declare": false, "id": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 14, 17 ], "loc": { - "start": { - "line": 2, - "column": 5 - }, "end": { "line": 2, "column": 8 + }, + "start": { + "line": 2, + "column": 5 } } }, @@ -31,13 +38,13 @@ 26 ], "loc": { - "start": { - "line": 2, - "column": 11 - }, "end": { "line": 2, "column": 17 + }, + "start": { + "line": 2, + "column": 11 } } }, @@ -48,13 +55,13 @@ 35 ], "loc": { - "start": { - "line": 2, - "column": 20 - }, "end": { "line": 2, "column": 26 + }, + "start": { + "line": 2, + "column": 20 } } } @@ -64,13 +71,13 @@ 35 ], "loc": { - "start": { - "line": 2, - "column": 11 - }, "end": { "line": 2, "column": 26 + }, + "start": { + "line": 2, + "column": 11 } } }, @@ -79,13 +86,13 @@ 35 ], "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 26 + }, + "start": { + "line": 2, + "column": 0 } } }, @@ -94,61 +101,52 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 114, 115 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, "init": { "type": "CallExpression", + "arguments": [], "callee": { "type": "Identifier", + "decorators": [], "name": "defineProps", + "optional": false, "range": [ 118, 129 ], "loc": { - "start": { - "line": 5, - "column": 10 - }, "end": { "line": 5, "column": 21 + }, + "start": { + "line": 5, + "column": 10 } } }, - "arguments": [], "optional": false, - "range": [ - 118, - 148 - ], - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 40 - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 129, @@ -163,32 +161,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 131, 134 ], "loc": { - "start": { - "line": 5, - "column": 23 - }, "end": { "line": 5, "column": 26 + }, + "start": { + "line": 5, + "column": 23 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 5, - "column": 26 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 26 } }, "range": [ @@ -199,19 +202,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 135, 136 ], "loc": { - "start": { - "line": 5, - "column": 27 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 27 } } }, @@ -220,13 +225,13 @@ 136 ], "loc": { - "start": { - "line": 5, - "column": 27 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 27 } } } @@ -236,13 +241,13 @@ 137 ], "loc": { - "start": { - "line": 5, - "column": 23 - }, "end": { "line": 5, "column": 29 + }, + "start": { + "line": 5, + "column": 23 } } }, @@ -251,32 +256,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "bar", + "optional": false, "range": [ 138, 141 ], "loc": { - "start": { - "line": 5, - "column": 30 - }, "end": { "line": 5, "column": 33 + }, + "start": { + "line": 5, + "column": 30 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 5, - "column": 33 - }, "end": { "line": 5, "column": 36 + }, + "start": { + "line": 5, + "column": 33 } }, "range": [ @@ -287,19 +297,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "U", + "optional": false, "range": [ 143, 144 ], "loc": { - "start": { - "line": 5, - "column": 35 - }, "end": { "line": 5, "column": 36 + }, + "start": { + "line": 5, + "column": 35 } } }, @@ -308,13 +320,13 @@ 144 ], "loc": { - "start": { - "line": 5, - "column": 35 - }, "end": { "line": 5, "column": 36 + }, + "start": { + "line": 5, + "column": 35 } } } @@ -324,13 +336,13 @@ 144 ], "loc": { - "start": { - "line": 5, - "column": 30 - }, "end": { "line": 5, "column": 36 + }, + "start": { + "line": 5, + "column": 30 } } } @@ -340,27 +352,41 @@ 145 ], "loc": { - "start": { - "line": 5, - "column": 22 - }, "end": { "line": 5, "column": 37 + }, + "start": { + "line": 5, + "column": 22 } } } ], "loc": { - "start": { - "line": 5, - "column": 21 - }, "end": { "line": 5, "column": 38 + }, + "start": { + "line": 5, + "column": 21 } } + }, + "range": [ + 118, + 148 + ], + "loc": { + "end": { + "line": 5, + "column": 40 + }, + "start": { + "line": 5, + "column": 10 + } } }, "range": [ @@ -368,30 +394,31 @@ 148 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 40 + }, + "start": { + "line": 5, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 108, 148 ], "loc": { - "start": { - "line": 5, - "column": 0 - }, "end": { "line": 5, "column": 40 + }, + "start": { + "line": 5, + "column": 0 } } }, @@ -400,76 +427,83 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 155, 158 ], "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, "init": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 161, 162 ], "loc": { - "start": { - "line": 6, - "column": 12 - }, "end": { "line": 6, "column": 13 + }, + "start": { + "line": 6, + "column": 12 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 163, 166 ], "loc": { - "start": { - "line": 6, - "column": 14 - }, "end": { "line": 6, "column": 17 + }, + "start": { + "line": 6, + "column": 14 } } }, - "computed": false, - "optional": false, "range": [ 161, 166 ], "loc": { - "start": { - "line": 6, - "column": 12 - }, "end": { "line": 6, "column": 17 + }, + "start": { + "line": 6, + "column": 12 } } }, @@ -478,125 +512,132 @@ 166 ], "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 17 + }, + "start": { + "line": 6, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 149, 166 ], "loc": { - "start": { - "line": 6, - "column": 0 - }, "end": { "line": 6, "column": 17 - } - } - }, + }, + "start": { + "line": 6, + "column": 0 + } + } + }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "decorators": [], + "name": "foo", + "optional": false, + "range": [ + 179, + 182 + ], + "loc": { + "end": { + "line": 7, + "column": 15 + }, + "start": { + "line": 7, + "column": 12 + } + } + } + ], "callee": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "console", + "optional": false, "range": [ 167, 174 ], "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 7 + }, + "start": { + "line": 7, + "column": 0 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "log", + "optional": false, "range": [ 175, 178 ], "loc": { - "start": { - "line": 7, - "column": 8 - }, "end": { "line": 7, "column": 11 + }, + "start": { + "line": 7, + "column": 8 } } }, - "computed": false, - "optional": false, "range": [ 167, 178 ], "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 11 + }, + "start": { + "line": 7, + "column": 0 } } }, - "arguments": [ - { - "type": "Identifier", - "name": "foo", - "range": [ - 179, - 182 - ], - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 15 - } - } - } - ], "optional": false, "range": [ 167, 183 ], "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 16 + }, + "start": { + "line": 7, + "column": 0 } } }, @@ -605,32 +646,19 @@ 183 ], "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 16 + }, + "start": { + "line": 7, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 9, - 183 - ], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 7, - "column": 16 - } - }, "tokens": [ { "type": "Punctuator", @@ -652,111 +680,111 @@ }, { "type": "Identifier", - "value": "type", + "loc": { + "end": { + "line": 2, + "column": 4 + }, + "start": { + "line": 2, + "column": 0 + } + }, "range": [ 9, 13 ], + "value": "type" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 0 + "column": 8 }, - "end": { + "start": { "line": 2, - "column": 4 + "column": 5 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 14, 17 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 5 + "column": 10 }, - "end": { + "start": { "line": 2, - "column": 8 + "column": 9 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 18, 19 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 9 + "column": 17 }, - "end": { + "start": { "line": 2, - "column": 10 + "column": 11 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 20, 26 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 11 + "column": 19 }, - "end": { + "start": { "line": 2, - "column": 17 + "column": 18 } - } - }, - { - "type": "Punctuator", - "value": "|", + }, "range": [ 27, 28 ], + "value": "|" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 18 + "column": 26 }, - "end": { + "start": { "line": 2, - "column": 19 + "column": 20 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 29, 35 ], - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 26 - } - } + "value": "string" }, { "type": "Punctuator", @@ -796,525 +824,525 @@ }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 5, + "column": 5 + }, + "start": { + "line": 5, + "column": 0 + } + }, "range": [ 108, 113 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 0 + "column": 7 }, - "end": { + "start": { "line": 5, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 114, 115 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 6 + "column": 9 }, - "end": { + "start": { "line": 5, - "column": 7 + "column": 8 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 116, 117 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 8 + "column": 21 }, - "end": { + "start": { "line": 5, - "column": 9 + "column": 10 } - } - }, - { - "type": "Identifier", - "value": "defineProps", + }, "range": [ 118, 129 ], + "value": "defineProps" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 10 + "column": 22 }, - "end": { + "start": { "line": 5, "column": 21 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 129, 130 ], + "value": "<" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 21 + "column": 23 }, - "end": { + "start": { "line": 5, "column": 22 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 130, 131 ], + "value": "{" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 22 + "column": 26 }, - "end": { + "start": { "line": 5, "column": 23 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 131, 134 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 23 + "column": 27 }, - "end": { + "start": { "line": 5, "column": 26 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 134, 135 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 26 + "column": 28 }, - "end": { + "start": { "line": 5, "column": 27 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 135, 136 ], + "value": "T" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 27 + "column": 29 }, - "end": { + "start": { "line": 5, "column": 28 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 136, 137 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 28 + "column": 33 }, - "end": { + "start": { "line": 5, - "column": 29 + "column": 30 } - } - }, - { - "type": "Identifier", - "value": "bar", + }, "range": [ 138, 141 ], + "value": "bar" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 30 + "column": 34 }, - "end": { + "start": { "line": 5, "column": 33 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 141, 142 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 33 + "column": 36 }, - "end": { + "start": { "line": 5, - "column": 34 + "column": 35 } - } - }, - { - "type": "Identifier", - "value": "U", + }, "range": [ 143, 144 ], + "value": "U" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 35 + "column": 37 }, - "end": { + "start": { "line": 5, "column": 36 } - } - }, - { - "type": "Punctuator", - "value": "}", + }, "range": [ 144, 145 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 36 + "column": 38 }, - "end": { + "start": { "line": 5, "column": 37 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 145, 146 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 37 + "column": 39 }, - "end": { + "start": { "line": 5, "column": 38 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 146, 147 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 38 + "column": 40 }, - "end": { + "start": { "line": 5, "column": 39 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 147, 148 ], - "loc": { - "start": { - "line": 5, - "column": 39 - }, - "end": { - "line": 5, - "column": 40 - } - } + "value": ")" }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 6, + "column": 5 + }, + "start": { + "line": 6, + "column": 0 + } + }, "range": [ 149, 154 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 6, - "column": 0 + "column": 9 }, - "end": { + "start": { "line": 6, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 155, 158 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 6, - "column": 6 + "column": 11 }, - "end": { + "start": { "line": 6, - "column": 9 + "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 159, 160 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 6, - "column": 10 + "column": 13 }, - "end": { + "start": { "line": 6, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 161, 162 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 6, - "column": 12 + "column": 14 }, - "end": { + "start": { "line": 6, "column": 13 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 162, 163 ], - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 14 - } - } + "value": "." }, { "type": "Identifier", - "value": "foo", - "range": [ - 163, - 166 - ], "loc": { - "start": { - "line": 6, - "column": 14 - }, "end": { "line": 6, "column": 17 + }, + "start": { + "line": 6, + "column": 14 } - } + }, + "range": [ + 163, + 166 + ], + "value": "foo" }, { "type": "Identifier", - "value": "console", + "loc": { + "end": { + "line": 7, + "column": 7 + }, + "start": { + "line": 7, + "column": 0 + } + }, "range": [ 167, 174 ], + "value": "console" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 0 + "column": 8 }, - "end": { + "start": { "line": 7, "column": 7 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 174, 175 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 7, - "column": 7 + "column": 11 }, - "end": { + "start": { "line": 7, "column": 8 } - } - }, - { - "type": "Identifier", - "value": "log", + }, "range": [ 175, 178 ], + "value": "log" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 8 + "column": 12 }, - "end": { + "start": { "line": 7, "column": 11 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 178, 179 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 7, - "column": 11 + "column": 15 }, - "end": { + "start": { "line": 7, "column": 12 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 179, 182 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 7, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 182, 183 ], - "loc": { - "start": { - "line": 7, - "column": 15 - }, - "end": { - "line": 7, - "column": 16 - } - } + "value": ")" }, { "type": "Punctuator", @@ -1335,7 +1363,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 7, + "column": 16 + }, + "start": { + "line": 2, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -1411,19 +1448,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 207, 210 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } } }, @@ -1431,19 +1470,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 207, 210 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } } }, @@ -1961,129 +2002,129 @@ }, { "type": "Identifier", - "value": "T", + "loc": { + "end": { + "line": 4, + "column": 34 + }, + "start": { + "line": 4, + "column": 33 + } + }, "range": [ 79, 80 ], + "value": "T" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 4, - "column": 33 + "column": 42 }, - "end": { + "start": { "line": 4, - "column": 34 + "column": 35 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 81, 88 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 35 + "column": 46 }, - "end": { + "start": { "line": 4, - "column": 42 + "column": 43 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 89, 92 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 4, - "column": 43 + "column": 47 }, - "end": { + "start": { "line": 4, "column": 46 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 92, 93 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 46 + "column": 49 }, - "end": { + "start": { "line": 4, - "column": 47 + "column": 48 } - } - }, - { - "type": "Identifier", - "value": "U", + }, "range": [ 94, 95 ], + "value": "U" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 4, - "column": 48 + "column": 57 }, - "end": { + "start": { "line": 4, - "column": 49 + "column": 50 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 96, 103 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 50 + "column": 59 }, - "end": { + "start": { "line": 4, - "column": 57 + "column": 58 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 104, 105 ], - "loc": { - "start": { - "line": 4, - "column": 58 - }, - "end": { - "line": 4, - "column": 59 - } - } + "value": "T" }, { "type": "Punctuator", @@ -2663,21 +2704,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 207, - 210 - ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } - } + }, + "range": [ + 207, + 210 + ], + "value": "foo" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/ast/vue3.3-generic-3/scope.json b/test/fixtures/ast/vue3.3-generic-3/scope.json index 07bfd168..5f979722 100644 --- a/test/fixtures/ast/vue3.3-generic-3/scope.json +++ b/test/fixtures/ast/vue3.3-generic-3/scope.json @@ -2,13 +2,19 @@ "type": "global", "variables": [ { - "name": "ClassMemberDecoratorContext", + "name": "ClassAccessorDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "DecoratorContext", + "name": "ClassAccessorDecoratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorTarget", "identifiers": [], "defs": [], "references": [] @@ -20,7 +26,7 @@ "references": [] }, { - "name": "ClassMethodDecoratorContext", + "name": "ClassFieldDecoratorContext", "identifiers": [], "defs": [], "references": [] @@ -32,43 +38,43 @@ "references": [] }, { - "name": "ClassSetterDecoratorContext", + "name": "ClassMemberDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorContext", + "name": "ClassMethodDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorTarget", + "name": "ClassSetterDecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassAccessorDecoratorResult", + "name": "DecoratorContext", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassFieldDecoratorContext", + "name": "DecoratorMetadata", "identifiers": [], "defs": [], "references": [] }, { - "name": "ClassDecorator", + "name": "DecoratorMetadataObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDecorator", + "name": "ClassDecorator", "identifiers": [], "defs": [], "references": [] @@ -86,265 +92,271 @@ "references": [] }, { - "name": "Symbol", + "name": "PropertyDecorator", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyKey", + "name": "Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptor", + "name": "ArrayBuffer", "identifiers": [], "defs": [], "references": [] }, { - "name": "PropertyDescriptorMap", + "name": "ArrayBufferConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Object", + "name": "ArrayBufferLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "ObjectConstructor", + "name": "ArrayBufferTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "Function", + "name": "ArrayBufferView", "identifiers": [], "defs": [], "references": [] }, { - "name": "FunctionConstructor", + "name": "ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisParameterType", + "name": "ArrayLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "OmitThisParameter", + "name": "Awaited", "identifiers": [], "defs": [], "references": [] }, { - "name": "CallableFunction", + "name": "Boolean", "identifiers": [], "defs": [], "references": [] }, { - "name": "NewableFunction", + "name": "BooleanConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IArguments", + "name": "CallableFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "String", + "name": "Capitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "StringConstructor", + "name": "ConcatArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Boolean", + "name": "ConstructorParameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "BooleanConstructor", + "name": "DataView", "identifiers": [], "defs": [], "references": [] }, { - "name": "Number", + "name": "DataViewConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NumberConstructor", + "name": "Date", "identifiers": [], "defs": [], "references": [] }, { - "name": "TemplateStringsArray", + "name": "DateConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportMeta", + "name": "Error", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportCallOptions", + "name": "ErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ImportAssertions", + "name": "EvalError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Math", + "name": "EvalErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Date", + "name": "Exclude", "identifiers": [], "defs": [], "references": [] }, { - "name": "DateConstructor", + "name": "Extract", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpMatchArray", + "name": "Float32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpExecArray", + "name": "Float32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExp", + "name": "Float64Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "RegExpConstructor", + "name": "Float64ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Error", + "name": "Function", "identifiers": [], "defs": [], "references": [] }, { - "name": "ErrorConstructor", + "name": "FunctionConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalError", + "name": "IArguments", "identifiers": [], "defs": [], "references": [] }, { - "name": "EvalErrorConstructor", + "name": "ImportAssertions", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeError", + "name": "ImportAttributes", "identifiers": [], "defs": [], "references": [] }, { - "name": "RangeErrorConstructor", + "name": "ImportCallOptions", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceError", + "name": "ImportMeta", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReferenceErrorConstructor", + "name": "InstanceType", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxError", + "name": "Int8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "SyntaxErrorConstructor", + "name": "Int8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeError", + "name": "Int16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypeErrorConstructor", + "name": "Int16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIError", + "name": "Int32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "URIErrorConstructor", + "name": "Int32ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Intl", "identifiers": [], "defs": [], "references": [] @@ -356,79 +368,79 @@ "references": [] }, { - "name": "ReadonlyArray", + "name": "Lowercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConcatArray", + "name": "Math", "identifiers": [], "defs": [], "references": [] }, { - "name": "Array", + "name": "NewableFunction", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayConstructor", + "name": "NoInfer", "identifiers": [], "defs": [], "references": [] }, { - "name": "TypedPropertyDescriptor", + "name": "NonNullable", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructorLike", + "name": "Number", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseLike", + "name": "NumberConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Promise", + "name": "Object", "identifiers": [], "defs": [], "references": [] }, { - "name": "Awaited", + "name": "ObjectConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayLike", + "name": "Omit", "identifiers": [], "defs": [], "references": [] }, { - "name": "Partial", + "name": "OmitThisParameter", "identifiers": [], "defs": [], "references": [] }, { - "name": "Required", + "name": "Parameters", "identifiers": [], "defs": [], "references": [] }, { - "name": "Readonly", + "name": "Partial", "identifiers": [], "defs": [], "references": [] @@ -440,283 +452,283 @@ "references": [] }, { - "name": "Record", + "name": "Promise", "identifiers": [], "defs": [], "references": [] }, { - "name": "Exclude", + "name": "PromiseConstructorLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "Extract", + "name": "PromiseLike", "identifiers": [], "defs": [], "references": [] }, { - "name": "Omit", + "name": "PropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "NonNullable", + "name": "PropertyDescriptorMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "Parameters", + "name": "PropertyKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "ConstructorParameters", + "name": "RangeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReturnType", + "name": "RangeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "InstanceType", + "name": "Readonly", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uppercase", + "name": "ReadonlyArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Lowercase", + "name": "Record", "identifiers": [], "defs": [], "references": [] }, { - "name": "Capitalize", + "name": "ReferenceError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uncapitalize", + "name": "ReferenceErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ThisType", + "name": "RegExp", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBuffer", + "name": "RegExpConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferTypes", + "name": "RegExpExecArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferLike", + "name": "RegExpMatchArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferConstructor", + "name": "Required", "identifiers": [], "defs": [], "references": [] }, { - "name": "ArrayBufferView", + "name": "ReturnType", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataView", + "name": "String", "identifiers": [], "defs": [], "references": [] }, { - "name": "DataViewConstructor", + "name": "StringConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8Array", + "name": "Symbol", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int8ArrayConstructor", + "name": "SyntaxError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8Array", + "name": "SyntaxErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ArrayConstructor", + "name": "TemplateStringsArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArray", + "name": "ThisParameterType", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint8ClampedArrayConstructor", + "name": "ThisType", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16Array", + "name": "TypedPropertyDescriptor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int16ArrayConstructor", + "name": "TypeError", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16Array", + "name": "TypeErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint16ArrayConstructor", + "name": "Uint8Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32Array", + "name": "Uint8ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Int32ArrayConstructor", + "name": "Uint8ClampedArray", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32Array", + "name": "Uint8ClampedArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Uint32ArrayConstructor", + "name": "Uint16Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32Array", + "name": "Uint16ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float32ArrayConstructor", + "name": "Uint32Array", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64Array", + "name": "Uint32ArrayConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Float64ArrayConstructor", + "name": "Uncapitalize", "identifiers": [], "defs": [], "references": [] }, { - "name": "Intl", + "name": "Uppercase", "identifiers": [], "defs": [], "references": [] }, { - "name": "Map", + "name": "URIError", "identifiers": [], "defs": [], "references": [] }, { - "name": "MapConstructor", + "name": "URIErrorConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "ReadonlyMap", + "name": "WeakKey", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMap", + "name": "WeakKeyTypes", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakMapConstructor", + "name": "Map", "identifiers": [], "defs": [], "references": [] }, { - "name": "Set", + "name": "MapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SetConstructor", + "name": "ReadonlyMap", "identifiers": [], "defs": [], "references": [] @@ -728,85 +740,139 @@ "references": [] }, { - "name": "WeakSet", + "name": "Set", "identifiers": [], "defs": [], "references": [] }, { - "name": "WeakSetConstructor", + "name": "SetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "SymbolConstructor", + "name": "WeakMap", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorYieldResult", + "name": "WeakMapConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorReturnResult", + "name": "WeakSet", "identifiers": [], "defs": [], "references": [] }, { - "name": "IteratorResult", + "name": "WeakSetConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterator", + "name": "SymbolConstructor", "identifiers": [], "defs": [], "references": [] }, { - "name": "Iterable", + "name": "ArrayIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "IterableIterator", + "name": "BuiltinIteratorReturn", "identifiers": [], "defs": [], "references": [] }, { - "name": "PromiseConstructor", + "name": "Iterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "Generator", + "name": "IterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunction", + "name": "Iterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "GeneratorFunctionConstructor", + "name": "IteratorObject", "identifiers": [], "defs": [], "references": [] }, { - "name": "ProxyHandler", + "name": "IteratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorReturnResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorYieldResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "MapIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SetIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "StringIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Generator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "GeneratorFunction", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "GeneratorFunctionConstructor", "identifiers": [], "defs": [], "references": [] @@ -817,12 +883,24 @@ "defs": [], "references": [] }, + { + "name": "ProxyHandler", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "Reflect", "identifiers": [], "defs": [], "references": [] }, + { + "name": "Atomics", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "SharedArrayBuffer", "identifiers": [], @@ -836,25 +914,25 @@ "references": [] }, { - "name": "Atomics", + "name": "AsyncIterable", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterator", + "name": "AsyncIterableIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterable", + "name": "AsyncIterator", "identifiers": [], "defs": [], "references": [] }, { - "name": "AsyncIterableIterator", + "name": "AsyncIteratorObject", "identifiers": [], "defs": [], "references": [] @@ -877,6 +955,192 @@ "defs": [], "references": [] }, + { + "name": "FlatArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigInt64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigIntConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigIntToLocaleStringOptions", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigUint64Array", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "BigUint64ArrayConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseFulfilledResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseRejectedResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseSettledResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RegExpStringIterator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AggregateError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AggregateErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FinalizationRegistry", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "FinalizationRegistryConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakRef", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "WeakRefConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ErrorOptions", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "RegExpIndicesArray", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PromiseWithResolvers", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposableStack", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "AsyncDisposableStackConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "Disposable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DisposableStack", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DisposableStackConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SuppressedError", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "SuppressedErrorConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ReadonlySetLike", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "IteratorObjectConstructor", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "const", "identifiers": [], @@ -893,13 +1157,13 @@ "type": "Identifier", "name": "defineProps", "loc": { - "start": { - "line": 5, - "column": 10 - }, "end": { "line": 5, "column": 21 + }, + "start": { + "line": 5, + "column": 10 } } }, @@ -918,13 +1182,13 @@ "type": "Identifier", "name": "T", "loc": { - "start": { - "line": 5, - "column": 27 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 27 } } }, @@ -943,13 +1207,13 @@ "type": "Identifier", "name": "U", "loc": { - "start": { - "line": 5, - "column": 35 - }, "end": { "line": 5, "column": 36 + }, + "start": { + "line": 5, + "column": 35 } } }, @@ -971,13 +1235,13 @@ "type": "Identifier", "name": "Foo", "loc": { - "start": { - "line": 2, - "column": 5 - }, "end": { "line": 2, "column": 8 + }, + "start": { + "line": 2, + "column": 5 } } } @@ -988,13 +1252,13 @@ "node": { "type": "TSTypeAliasDeclaration", "loc": { - "start": { - "line": 2, - "column": 0 - }, "end": { "line": 2, "column": 26 + }, + "start": { + "line": 2, + "column": 0 } } }, @@ -1007,13 +1271,13 @@ "type": "Identifier", "name": "Foo", "loc": { - "start": { - "line": 2, - "column": 5 - }, "end": { "line": 2, "column": 8 + }, + "start": { + "line": 2, + "column": 5 } } }, @@ -1022,13 +1286,13 @@ "type": "Identifier", "name": "Foo", "loc": { - "start": { - "line": 2, - "column": 5 - }, "end": { "line": 2, "column": 8 + }, + "start": { + "line": 2, + "column": 5 } } }, @@ -1044,13 +1308,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } } @@ -1061,13 +1325,13 @@ "node": { "type": "VariableDeclarator", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 40 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1080,13 +1344,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1095,13 +1359,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1112,13 +1376,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 6, - "column": 12 - }, "end": { "line": 6, "column": 13 + }, + "start": { + "line": 6, + "column": 12 } } }, @@ -1127,13 +1391,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1148,13 +1412,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } } @@ -1165,13 +1429,13 @@ "node": { "type": "VariableDeclarator", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 17 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1184,13 +1448,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1199,13 +1463,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1216,13 +1480,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 7, - "column": 12 - }, "end": { "line": 7, "column": 15 + }, + "start": { + "line": 7, + "column": 12 } } }, @@ -1231,13 +1495,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1248,13 +1512,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1263,13 +1527,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1285,13 +1549,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1300,13 +1564,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1317,13 +1581,13 @@ "type": "Identifier", "name": "defineProps", "loc": { - "start": { - "line": 5, - "column": 10 - }, "end": { "line": 5, "column": 21 + }, + "start": { + "line": 5, + "column": 10 } } }, @@ -1335,13 +1599,13 @@ "type": "Identifier", "name": "T", "loc": { - "start": { - "line": 5, - "column": 27 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 27 } } }, @@ -1353,13 +1617,13 @@ "type": "Identifier", "name": "U", "loc": { - "start": { - "line": 5, - "column": 35 - }, "end": { "line": 5, "column": 36 + }, + "start": { + "line": 5, + "column": 35 } } }, @@ -1371,13 +1635,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1386,13 +1650,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1403,13 +1667,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 6, - "column": 12 - }, "end": { "line": 6, "column": 13 + }, + "start": { + "line": 6, + "column": 12 } } }, @@ -1418,13 +1682,13 @@ "type": "Identifier", "name": "p", "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, @@ -1435,13 +1699,13 @@ "type": "Identifier", "name": "console", "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 7 + }, + "start": { + "line": 7, + "column": 0 } } }, @@ -1454,13 +1718,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 7, - "column": 12 - }, "end": { "line": 7, "column": 15 + }, + "start": { + "line": 7, + "column": 12 } } }, @@ -1469,13 +1733,13 @@ "type": "Identifier", "name": "foo", "loc": { - "start": { - "line": 6, - "column": 6 - }, "end": { "line": 6, "column": 9 + }, + "start": { + "line": 6, + "column": 6 } } }, @@ -1489,13 +1753,13 @@ "type": "Identifier", "name": "defineProps", "loc": { - "start": { - "line": 5, - "column": 10 - }, "end": { "line": 5, "column": 21 + }, + "start": { + "line": 5, + "column": 10 } } }, @@ -1507,13 +1771,13 @@ "type": "Identifier", "name": "T", "loc": { - "start": { - "line": 5, - "column": 27 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 27 } } }, @@ -1525,13 +1789,13 @@ "type": "Identifier", "name": "U", "loc": { - "start": { - "line": 5, - "column": 35 - }, "end": { "line": 5, "column": 36 + }, + "start": { + "line": 5, + "column": 35 } } }, @@ -1543,13 +1807,13 @@ "type": "Identifier", "name": "console", "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 7 + }, + "start": { + "line": 7, + "column": 0 } } }, @@ -1566,13 +1830,13 @@ "type": "Identifier", "name": "console", "loc": { - "start": { - "line": 7, - "column": 0 - }, "end": { "line": 7, "column": 7 + }, + "start": { + "line": 7, + "column": 0 } } }, diff --git a/test/fixtures/ast/vue3.3-generic-4-with-spaces/ast.json b/test/fixtures/ast/vue3.3-generic-4-with-spaces/ast.json index 401cda3f..6efed59a 100644 --- a/test/fixtures/ast/vue3.3-generic-4-with-spaces/ast.json +++ b/test/fixtures/ast/vue3.3-generic-4-with-spaces/ast.json @@ -1,23 +1,30 @@ { "type": "Program", + "range": [ + 92, + 195 + ], "body": [ { "type": "TSTypeAliasDeclaration", + "declare": false, "id": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 97, 100 ], "loc": { - "start": { - "line": 8, - "column": 5 - }, "end": { "line": 8, "column": 8 + }, + "start": { + "line": 8, + "column": 5 } } }, @@ -31,13 +38,13 @@ 109 ], "loc": { - "start": { - "line": 8, - "column": 11 - }, "end": { "line": 8, "column": 17 + }, + "start": { + "line": 8, + "column": 11 } } }, @@ -48,13 +55,13 @@ 118 ], "loc": { - "start": { - "line": 8, - "column": 20 - }, "end": { "line": 8, "column": 26 + }, + "start": { + "line": 8, + "column": 20 } } } @@ -64,13 +71,13 @@ 118 ], "loc": { - "start": { - "line": 8, - "column": 11 - }, "end": { "line": 8, "column": 26 + }, + "start": { + "line": 8, + "column": 11 } } }, @@ -79,13 +86,13 @@ 118 ], "loc": { - "start": { - "line": 8, - "column": 0 - }, "end": { "line": 8, "column": 26 + }, + "start": { + "line": 8, + "column": 0 } } }, @@ -94,61 +101,52 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 125, 126 ], "loc": { - "start": { - "line": 9, - "column": 6 - }, "end": { "line": 9, "column": 7 + }, + "start": { + "line": 9, + "column": 6 } } }, "init": { "type": "CallExpression", + "arguments": [], "callee": { "type": "Identifier", + "decorators": [], "name": "defineProps", + "optional": false, "range": [ 129, 140 ], "loc": { - "start": { - "line": 9, - "column": 10 - }, "end": { "line": 9, "column": 21 + }, + "start": { + "line": 9, + "column": 10 } } }, - "arguments": [], "optional": false, - "range": [ - 129, - 159 - ], - "loc": { - "start": { - "line": 9, - "column": 10 - }, - "end": { - "line": 9, - "column": 40 - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 140, @@ -163,32 +161,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 142, 145 ], "loc": { - "start": { - "line": 9, - "column": 23 - }, "end": { "line": 9, "column": 26 + }, + "start": { + "line": 9, + "column": 23 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 9, - "column": 26 - }, "end": { "line": 9, "column": 28 + }, + "start": { + "line": 9, + "column": 26 } }, "range": [ @@ -199,19 +202,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 146, 147 ], "loc": { - "start": { - "line": 9, - "column": 27 - }, "end": { "line": 9, "column": 28 + }, + "start": { + "line": 9, + "column": 27 } } }, @@ -220,13 +225,13 @@ 147 ], "loc": { - "start": { - "line": 9, - "column": 27 - }, "end": { "line": 9, "column": 28 + }, + "start": { + "line": 9, + "column": 27 } } } @@ -236,13 +241,13 @@ 148 ], "loc": { - "start": { - "line": 9, - "column": 23 - }, "end": { "line": 9, "column": 29 + }, + "start": { + "line": 9, + "column": 23 } } }, @@ -251,32 +256,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "bar", + "optional": false, "range": [ 149, 152 ], "loc": { - "start": { - "line": 9, - "column": 30 - }, "end": { "line": 9, "column": 33 + }, + "start": { + "line": 9, + "column": 30 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 9, - "column": 33 - }, "end": { "line": 9, "column": 36 + }, + "start": { + "line": 9, + "column": 33 } }, "range": [ @@ -287,19 +297,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "U", + "optional": false, "range": [ 154, 155 ], "loc": { - "start": { - "line": 9, - "column": 35 - }, "end": { "line": 9, "column": 36 + }, + "start": { + "line": 9, + "column": 35 } } }, @@ -308,13 +320,13 @@ 155 ], "loc": { - "start": { - "line": 9, - "column": 35 - }, "end": { "line": 9, "column": 36 + }, + "start": { + "line": 9, + "column": 35 } } } @@ -324,13 +336,13 @@ 155 ], "loc": { - "start": { - "line": 9, - "column": 30 - }, "end": { "line": 9, "column": 36 + }, + "start": { + "line": 9, + "column": 30 } } } @@ -340,27 +352,41 @@ 156 ], "loc": { - "start": { - "line": 9, - "column": 22 - }, "end": { "line": 9, "column": 37 + }, + "start": { + "line": 9, + "column": 22 } } } ], "loc": { - "start": { - "line": 9, - "column": 21 - }, "end": { "line": 9, "column": 38 + }, + "start": { + "line": 9, + "column": 21 } } + }, + "range": [ + 129, + 159 + ], + "loc": { + "end": { + "line": 9, + "column": 40 + }, + "start": { + "line": 9, + "column": 10 + } } }, "range": [ @@ -368,30 +394,31 @@ 159 ], "loc": { - "start": { - "line": 9, - "column": 6 - }, "end": { "line": 9, "column": 40 + }, + "start": { + "line": 9, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 119, 159 ], "loc": { - "start": { - "line": 9, - "column": 0 - }, "end": { "line": 9, "column": 40 + }, + "start": { + "line": 9, + "column": 0 } } }, @@ -400,76 +427,83 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 166, 169 ], "loc": { - "start": { - "line": 10, - "column": 6 - }, "end": { "line": 10, "column": 9 + }, + "start": { + "line": 10, + "column": 6 } } }, "init": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 172, 173 ], "loc": { - "start": { - "line": 10, - "column": 12 - }, "end": { "line": 10, "column": 13 + }, + "start": { + "line": 10, + "column": 12 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 174, 177 ], "loc": { - "start": { - "line": 10, - "column": 14 - }, "end": { "line": 10, "column": 17 + }, + "start": { + "line": 10, + "column": 14 } } }, - "computed": false, - "optional": false, "range": [ 172, 177 ], "loc": { - "start": { - "line": 10, - "column": 12 - }, "end": { "line": 10, "column": 17 + }, + "start": { + "line": 10, + "column": 12 } } }, @@ -478,125 +512,132 @@ 177 ], "loc": { - "start": { - "line": 10, - "column": 6 - }, "end": { "line": 10, "column": 17 + }, + "start": { + "line": 10, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 160, 177 ], "loc": { - "start": { - "line": 10, - "column": 0 - }, "end": { "line": 10, "column": 17 - } - } - }, + }, + "start": { + "line": 10, + "column": 0 + } + } + }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "decorators": [], + "name": "foo", + "optional": false, + "range": [ + 190, + 193 + ], + "loc": { + "end": { + "line": 11, + "column": 15 + }, + "start": { + "line": 11, + "column": 12 + } + } + } + ], "callee": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "console", + "optional": false, "range": [ 178, 185 ], "loc": { - "start": { - "line": 11, - "column": 0 - }, "end": { "line": 11, "column": 7 + }, + "start": { + "line": 11, + "column": 0 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "log", + "optional": false, "range": [ 186, 189 ], "loc": { - "start": { - "line": 11, - "column": 8 - }, "end": { "line": 11, "column": 11 + }, + "start": { + "line": 11, + "column": 8 } } }, - "computed": false, - "optional": false, "range": [ 178, 189 ], "loc": { - "start": { - "line": 11, - "column": 0 - }, "end": { "line": 11, "column": 11 + }, + "start": { + "line": 11, + "column": 0 } } }, - "arguments": [ - { - "type": "Identifier", - "name": "foo", - "range": [ - 190, - 193 - ], - "loc": { - "start": { - "line": 11, - "column": 12 - }, - "end": { - "line": 11, - "column": 15 - } - } - } - ], "optional": false, "range": [ 178, 194 ], "loc": { - "start": { - "line": 11, - "column": 0 - }, "end": { "line": 11, "column": 16 + }, + "start": { + "line": 11, + "column": 0 } } }, @@ -605,32 +646,19 @@ 194 ], "loc": { - "start": { - "line": 11, - "column": 0 - }, "end": { "line": 11, "column": 16 + }, + "start": { + "line": 11, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 92, - 195 - ], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 12, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -652,633 +680,633 @@ }, { "type": "Identifier", - "value": "type", + "loc": { + "end": { + "line": 8, + "column": 4 + }, + "start": { + "line": 8, + "column": 0 + } + }, "range": [ 92, 96 ], + "value": "type" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 8, - "column": 0 + "column": 8 }, - "end": { + "start": { "line": 8, - "column": 4 + "column": 5 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 97, 100 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 8, - "column": 5 + "column": 10 }, - "end": { + "start": { "line": 8, - "column": 8 + "column": 9 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 101, 102 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 8, - "column": 9 + "column": 17 }, - "end": { + "start": { "line": 8, - "column": 10 + "column": 11 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 103, 109 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 8, - "column": 11 + "column": 19 }, - "end": { + "start": { "line": 8, - "column": 17 + "column": 18 } - } - }, - { - "type": "Punctuator", - "value": "|", + }, "range": [ 110, 111 ], + "value": "|" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 8, - "column": 18 + "column": 26 }, - "end": { + "start": { "line": 8, - "column": 19 + "column": 20 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 112, 118 ], - "loc": { - "start": { - "line": 8, - "column": 20 - }, - "end": { - "line": 8, - "column": 26 - } - } + "value": "string" }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 9, + "column": 5 + }, + "start": { + "line": 9, + "column": 0 + } + }, "range": [ 119, 124 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 0 + "column": 7 }, - "end": { + "start": { "line": 9, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 125, 126 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 6 + "column": 9 }, - "end": { + "start": { "line": 9, - "column": 7 + "column": 8 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 127, 128 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 8 + "column": 21 }, - "end": { + "start": { "line": 9, - "column": 9 + "column": 10 } - } - }, - { - "type": "Identifier", - "value": "defineProps", + }, "range": [ 129, 140 ], + "value": "defineProps" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 10 + "column": 22 }, - "end": { + "start": { "line": 9, "column": 21 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 140, 141 ], + "value": "<" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 21 + "column": 23 }, - "end": { + "start": { "line": 9, "column": 22 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 141, 142 ], + "value": "{" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 22 + "column": 26 }, - "end": { + "start": { "line": 9, "column": 23 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 142, 145 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 23 + "column": 27 }, - "end": { + "start": { "line": 9, "column": 26 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 145, 146 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 26 + "column": 28 }, - "end": { + "start": { "line": 9, "column": 27 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 146, 147 ], + "value": "T" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 27 + "column": 29 }, - "end": { + "start": { "line": 9, "column": 28 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 147, 148 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 28 + "column": 33 }, - "end": { + "start": { "line": 9, - "column": 29 + "column": 30 } - } - }, - { - "type": "Identifier", - "value": "bar", + }, "range": [ 149, 152 ], + "value": "bar" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 30 + "column": 34 }, - "end": { + "start": { "line": 9, "column": 33 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 152, 153 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 33 + "column": 36 }, - "end": { + "start": { "line": 9, - "column": 34 + "column": 35 } - } - }, - { - "type": "Identifier", - "value": "U", + }, "range": [ 154, 155 ], + "value": "U" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 35 + "column": 37 }, - "end": { + "start": { "line": 9, "column": 36 } - } - }, - { - "type": "Punctuator", - "value": "}", + }, "range": [ 155, 156 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 36 + "column": 38 }, - "end": { + "start": { "line": 9, "column": 37 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 156, 157 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 37 + "column": 39 }, - "end": { + "start": { "line": 9, "column": 38 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 157, 158 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 38 + "column": 40 }, - "end": { + "start": { "line": 9, "column": 39 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 158, 159 ], - "loc": { - "start": { - "line": 9, - "column": 39 - }, - "end": { - "line": 9, - "column": 40 - } - } + "value": ")" }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 10, + "column": 5 + }, + "start": { + "line": 10, + "column": 0 + } + }, "range": [ 160, 165 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 0 + "column": 9 }, - "end": { + "start": { "line": 10, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 166, 169 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 6 + "column": 11 }, - "end": { + "start": { "line": 10, - "column": 9 + "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 170, 171 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 10 + "column": 13 }, - "end": { + "start": { "line": 10, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 172, 173 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 12 + "column": 14 }, - "end": { + "start": { "line": 10, "column": 13 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 173, 174 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 13 + "column": 17 }, - "end": { + "start": { "line": 10, "column": 14 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 174, 177 ], - "loc": { - "start": { - "line": 10, - "column": 14 - }, - "end": { - "line": 10, - "column": 17 - } - } + "value": "foo" }, { "type": "Identifier", - "value": "console", + "loc": { + "end": { + "line": 11, + "column": 7 + }, + "start": { + "line": 11, + "column": 0 + } + }, "range": [ 178, 185 ], + "value": "console" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 11, - "column": 0 + "column": 8 }, - "end": { + "start": { "line": 11, "column": 7 - } - } - }, - { - "type": "Punctuator", - "value": ".", + } + }, "range": [ 185, 186 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 11, - "column": 7 + "column": 11 }, - "end": { + "start": { "line": 11, "column": 8 } - } - }, - { - "type": "Identifier", - "value": "log", + }, "range": [ 186, 189 ], + "value": "log" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 11, - "column": 8 + "column": 12 }, - "end": { + "start": { "line": 11, "column": 11 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 189, 190 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 11, - "column": 11 + "column": 15 }, - "end": { + "start": { "line": 11, "column": 12 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 190, 193 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 11, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 11, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 193, 194 ], - "loc": { - "start": { - "line": 11, - "column": 15 - }, - "end": { - "line": 11, - "column": 16 - } - } + "value": ")" }, { "type": "Punctuator", @@ -1299,7 +1327,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 12, + "column": 0 + }, + "start": { + "line": 8, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -1375,19 +1412,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 218, 221 ], "loc": { - "start": { - "line": 14, - "column": 2 - }, "end": { "line": 14, "column": 5 + }, + "start": { + "line": 14, + "column": 2 } } }, @@ -1395,19 +1434,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 218, 221 ], "loc": { - "start": { - "line": 14, - "column": 2 - }, "end": { "line": 14, "column": 5 + }, + "start": { + "line": 14, + "column": 2 } } }, @@ -1601,129 +1642,129 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 36, - 37 - ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } - } + }, + "range": [ + 36, + 37 + ], + "value": "T" }, { "type": "Keyword", - "value": "extends", + "loc": { + "end": { + "line": 3, + "column": 11 + }, + "start": { + "line": 3, + "column": 4 + } + }, "range": [ 42, 49 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 4 + "column": 15 }, - "end": { + "start": { "line": 3, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 50, 53 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 3, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 53, 54 ], - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", - "range": [ - 73, - 74 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 73, + 74 + ], + "value": "U" }, { "type": "Keyword", - "value": "extends", - "range": [ - 75, - 82 - ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 11 + }, + "start": { + "line": 5, + "column": 4 } - } + }, + "range": [ + 75, + 82 + ], + "value": "extends" }, { "type": "Identifier", - "value": "T", - "range": [ - 87, - 88 - ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 5 + }, + "start": { + "line": 6, + "column": 4 } - } + }, + "range": [ + 87, + 88 + ], + "value": "T" }, { "type": "Punctuator", @@ -2519,21 +2560,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 218, - 221 - ], "loc": { - "start": { - "line": 14, - "column": 2 - }, "end": { "line": 14, "column": 5 + }, + "start": { + "line": 14, + "column": 2 } - } + }, + "range": [ + 218, + 221 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -2611,21 +2652,21 @@ "comments": [ { "type": "Line", - "value": " Comments", - "range": [ - 59, - 70 - ], "loc": { - "start": { - "line": 4, - "column": 4 - }, "end": { "line": 4, "column": 15 + }, + "start": { + "line": 4, + "column": 4 } - } + }, + "range": [ + 59, + 70 + ], + "value": " Comments" } ], "errors": [] diff --git a/test/fixtures/ast/vue3.3-generic-5-with-spaces/ast.json b/test/fixtures/ast/vue3.3-generic-5-with-spaces/ast.json index 86d3fb49..b2319f0c 100644 --- a/test/fixtures/ast/vue3.3-generic-5-with-spaces/ast.json +++ b/test/fixtures/ast/vue3.3-generic-5-with-spaces/ast.json @@ -1,23 +1,30 @@ { "type": "Program", + "range": [ + 142, + 245 + ], "body": [ { "type": "TSTypeAliasDeclaration", + "declare": false, "id": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 147, 150 ], "loc": { - "start": { - "line": 9, - "column": 5 - }, "end": { "line": 9, "column": 8 + }, + "start": { + "line": 9, + "column": 5 } } }, @@ -31,13 +38,13 @@ 159 ], "loc": { - "start": { - "line": 9, - "column": 11 - }, "end": { "line": 9, "column": 17 + }, + "start": { + "line": 9, + "column": 11 } } }, @@ -48,13 +55,13 @@ 168 ], "loc": { - "start": { - "line": 9, - "column": 20 - }, "end": { "line": 9, "column": 26 + }, + "start": { + "line": 9, + "column": 20 } } } @@ -64,13 +71,13 @@ 168 ], "loc": { - "start": { - "line": 9, - "column": 11 - }, "end": { "line": 9, "column": 26 + }, + "start": { + "line": 9, + "column": 11 } } }, @@ -79,13 +86,13 @@ 168 ], "loc": { - "start": { - "line": 9, - "column": 0 - }, "end": { "line": 9, "column": 26 + }, + "start": { + "line": 9, + "column": 0 } } }, @@ -94,61 +101,52 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 175, 176 ], "loc": { - "start": { - "line": 10, - "column": 6 - }, "end": { "line": 10, "column": 7 + }, + "start": { + "line": 10, + "column": 6 } } }, "init": { "type": "CallExpression", + "arguments": [], "callee": { "type": "Identifier", + "decorators": [], "name": "defineProps", + "optional": false, "range": [ 179, 190 ], "loc": { - "start": { - "line": 10, - "column": 10 - }, "end": { "line": 10, "column": 21 + }, + "start": { + "line": 10, + "column": 10 } } }, - "arguments": [], "optional": false, - "range": [ - 179, - 209 - ], - "loc": { - "start": { - "line": 10, - "column": 10 - }, - "end": { - "line": 10, - "column": 40 - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 190, @@ -163,32 +161,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 192, 195 ], "loc": { - "start": { - "line": 10, - "column": 23 - }, "end": { "line": 10, "column": 26 + }, + "start": { + "line": 10, + "column": 23 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 10, - "column": 26 - }, "end": { "line": 10, "column": 28 + }, + "start": { + "line": 10, + "column": 26 } }, "range": [ @@ -199,19 +202,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 196, 197 ], "loc": { - "start": { - "line": 10, - "column": 27 - }, "end": { "line": 10, "column": 28 + }, + "start": { + "line": 10, + "column": 27 } } }, @@ -220,13 +225,13 @@ 197 ], "loc": { - "start": { - "line": 10, - "column": 27 - }, "end": { "line": 10, "column": 28 + }, + "start": { + "line": 10, + "column": 27 } } } @@ -236,13 +241,13 @@ 198 ], "loc": { - "start": { - "line": 10, - "column": 23 - }, "end": { "line": 10, "column": 29 + }, + "start": { + "line": 10, + "column": 23 } } }, @@ -251,32 +256,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "bar", + "optional": false, "range": [ 199, 202 ], "loc": { - "start": { - "line": 10, - "column": 30 - }, "end": { "line": 10, "column": 33 + }, + "start": { + "line": 10, + "column": 30 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 10, - "column": 33 - }, "end": { "line": 10, "column": 36 + }, + "start": { + "line": 10, + "column": 33 } }, "range": [ @@ -287,19 +297,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "U", + "optional": false, "range": [ 204, 205 ], "loc": { - "start": { - "line": 10, - "column": 35 - }, "end": { "line": 10, "column": 36 + }, + "start": { + "line": 10, + "column": 35 } } }, @@ -308,13 +320,13 @@ 205 ], "loc": { - "start": { - "line": 10, - "column": 35 - }, "end": { "line": 10, "column": 36 + }, + "start": { + "line": 10, + "column": 35 } } } @@ -324,13 +336,13 @@ 205 ], "loc": { - "start": { - "line": 10, - "column": 30 - }, "end": { "line": 10, "column": 36 + }, + "start": { + "line": 10, + "column": 30 } } } @@ -340,27 +352,41 @@ 206 ], "loc": { - "start": { - "line": 10, - "column": 22 - }, "end": { "line": 10, "column": 37 + }, + "start": { + "line": 10, + "column": 22 } } } ], "loc": { - "start": { - "line": 10, - "column": 21 - }, "end": { "line": 10, "column": 38 + }, + "start": { + "line": 10, + "column": 21 } } + }, + "range": [ + 179, + 209 + ], + "loc": { + "end": { + "line": 10, + "column": 40 + }, + "start": { + "line": 10, + "column": 10 + } } }, "range": [ @@ -368,30 +394,31 @@ 209 ], "loc": { - "start": { - "line": 10, - "column": 6 - }, "end": { "line": 10, "column": 40 + }, + "start": { + "line": 10, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 169, 209 ], "loc": { - "start": { - "line": 10, - "column": 0 - }, "end": { "line": 10, "column": 40 + }, + "start": { + "line": 10, + "column": 0 } } }, @@ -400,76 +427,83 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 216, 219 ], "loc": { - "start": { - "line": 11, - "column": 6 - }, "end": { "line": 11, "column": 9 + }, + "start": { + "line": 11, + "column": 6 } } }, "init": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 222, 223 ], "loc": { - "start": { - "line": 11, - "column": 12 - }, "end": { "line": 11, "column": 13 + }, + "start": { + "line": 11, + "column": 12 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 224, 227 ], "loc": { - "start": { - "line": 11, - "column": 14 - }, "end": { "line": 11, "column": 17 + }, + "start": { + "line": 11, + "column": 14 } } }, - "computed": false, - "optional": false, "range": [ 222, 227 ], "loc": { - "start": { - "line": 11, - "column": 12 - }, "end": { "line": 11, "column": 17 + }, + "start": { + "line": 11, + "column": 12 } } }, @@ -478,125 +512,132 @@ 227 ], "loc": { - "start": { - "line": 11, - "column": 6 - }, "end": { "line": 11, "column": 17 + }, + "start": { + "line": 11, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 210, 227 ], "loc": { - "start": { - "line": 11, - "column": 0 - }, "end": { "line": 11, "column": 17 - } - } - }, + }, + "start": { + "line": 11, + "column": 0 + } + } + }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "decorators": [], + "name": "foo", + "optional": false, + "range": [ + 240, + 243 + ], + "loc": { + "end": { + "line": 12, + "column": 15 + }, + "start": { + "line": 12, + "column": 12 + } + } + } + ], "callee": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "console", + "optional": false, "range": [ 228, 235 ], "loc": { - "start": { - "line": 12, - "column": 0 - }, "end": { "line": 12, "column": 7 + }, + "start": { + "line": 12, + "column": 0 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "log", + "optional": false, "range": [ 236, 239 ], "loc": { - "start": { - "line": 12, - "column": 8 - }, "end": { "line": 12, "column": 11 + }, + "start": { + "line": 12, + "column": 8 } } }, - "computed": false, - "optional": false, "range": [ 228, 239 ], "loc": { - "start": { - "line": 12, - "column": 0 - }, "end": { "line": 12, "column": 11 + }, + "start": { + "line": 12, + "column": 0 } } }, - "arguments": [ - { - "type": "Identifier", - "name": "foo", - "range": [ - 240, - 243 - ], - "loc": { - "start": { - "line": 12, - "column": 12 - }, - "end": { - "line": 12, - "column": 15 - } - } - } - ], "optional": false, "range": [ 228, 244 ], "loc": { - "start": { - "line": 12, - "column": 0 - }, "end": { "line": 12, "column": 16 + }, + "start": { + "line": 12, + "column": 0 } } }, @@ -605,32 +646,19 @@ 244 ], "loc": { - "start": { - "line": 12, - "column": 0 - }, "end": { "line": 12, "column": 16 + }, + "start": { + "line": 12, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 142, - 245 - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 13, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -652,633 +680,633 @@ }, { "type": "Identifier", - "value": "type", + "loc": { + "end": { + "line": 9, + "column": 4 + }, + "start": { + "line": 9, + "column": 0 + } + }, "range": [ 142, 146 ], + "value": "type" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 0 + "column": 8 }, - "end": { + "start": { "line": 9, - "column": 4 + "column": 5 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 147, 150 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 5 + "column": 10 }, - "end": { + "start": { "line": 9, - "column": 8 + "column": 9 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 151, 152 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 9 + "column": 17 }, - "end": { + "start": { "line": 9, - "column": 10 + "column": 11 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 153, 159 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 11 + "column": 19 }, - "end": { + "start": { "line": 9, - "column": 17 + "column": 18 } - } - }, - { - "type": "Punctuator", - "value": "|", + }, "range": [ 160, 161 ], + "value": "|" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 18 + "column": 26 }, - "end": { + "start": { "line": 9, - "column": 19 + "column": 20 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 162, 168 ], - "loc": { - "start": { - "line": 9, - "column": 20 - }, - "end": { - "line": 9, - "column": 26 - } - } + "value": "string" }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 10, + "column": 5 + }, + "start": { + "line": 10, + "column": 0 + } + }, "range": [ 169, 174 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 0 + "column": 7 }, - "end": { + "start": { "line": 10, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 175, 176 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 6 + "column": 9 }, - "end": { + "start": { "line": 10, - "column": 7 + "column": 8 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 177, 178 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 8 + "column": 21 }, - "end": { + "start": { "line": 10, - "column": 9 + "column": 10 } - } - }, - { - "type": "Identifier", - "value": "defineProps", + }, "range": [ 179, 190 ], + "value": "defineProps" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 10 + "column": 22 }, - "end": { + "start": { "line": 10, "column": 21 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 190, 191 ], + "value": "<" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 21 + "column": 23 }, - "end": { + "start": { "line": 10, "column": 22 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 191, 192 ], + "value": "{" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 22 + "column": 26 }, - "end": { + "start": { "line": 10, "column": 23 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 192, 195 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 23 + "column": 27 }, - "end": { + "start": { "line": 10, "column": 26 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 195, 196 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 26 + "column": 28 }, - "end": { + "start": { "line": 10, "column": 27 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 196, 197 ], + "value": "T" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 27 + "column": 29 }, - "end": { + "start": { "line": 10, "column": 28 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 197, 198 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 28 + "column": 33 }, - "end": { + "start": { "line": 10, - "column": 29 + "column": 30 } - } - }, - { - "type": "Identifier", - "value": "bar", + }, "range": [ 199, 202 ], + "value": "bar" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 30 + "column": 34 }, - "end": { + "start": { "line": 10, "column": 33 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 202, 203 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 33 + "column": 36 }, - "end": { + "start": { "line": 10, - "column": 34 + "column": 35 } - } - }, - { - "type": "Identifier", - "value": "U", + }, "range": [ 204, 205 ], + "value": "U" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 35 + "column": 37 }, - "end": { + "start": { "line": 10, "column": 36 } - } - }, - { - "type": "Punctuator", - "value": "}", + }, "range": [ 205, 206 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 36 + "column": 38 }, - "end": { + "start": { "line": 10, "column": 37 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 206, 207 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 37 + "column": 39 }, - "end": { + "start": { "line": 10, - "column": 38 - } - } - }, - { - "type": "Punctuator", - "value": "(", + "column": 38 + } + }, "range": [ 207, 208 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 38 + "column": 40 }, - "end": { + "start": { "line": 10, "column": 39 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 208, 209 ], - "loc": { - "start": { - "line": 10, - "column": 39 - }, - "end": { - "line": 10, - "column": 40 - } - } + "value": ")" }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 11, + "column": 5 + }, + "start": { + "line": 11, + "column": 0 + } + }, "range": [ 210, 215 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 11, - "column": 0 + "column": 9 }, - "end": { + "start": { "line": 11, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 216, 219 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 11, - "column": 6 + "column": 11 }, - "end": { + "start": { "line": 11, - "column": 9 + "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 220, 221 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 11, - "column": 10 + "column": 13 }, - "end": { + "start": { "line": 11, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 222, 223 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 11, - "column": 12 + "column": 14 }, - "end": { + "start": { "line": 11, "column": 13 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 223, 224 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 11, - "column": 13 + "column": 17 }, - "end": { + "start": { "line": 11, "column": 14 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 224, 227 ], - "loc": { - "start": { - "line": 11, - "column": 14 - }, - "end": { - "line": 11, - "column": 17 - } - } + "value": "foo" }, { "type": "Identifier", - "value": "console", + "loc": { + "end": { + "line": 12, + "column": 7 + }, + "start": { + "line": 12, + "column": 0 + } + }, "range": [ 228, 235 ], + "value": "console" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 0 + "column": 8 }, - "end": { + "start": { "line": 12, "column": 7 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 235, 236 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 7 + "column": 11 }, - "end": { + "start": { "line": 12, "column": 8 } - } - }, - { - "type": "Identifier", - "value": "log", + }, "range": [ 236, 239 ], + "value": "log" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 8 + "column": 12 }, - "end": { + "start": { "line": 12, "column": 11 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 239, 240 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 11 + "column": 15 }, - "end": { + "start": { "line": 12, "column": 12 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 240, 243 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 12, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 243, 244 ], - "loc": { - "start": { - "line": 12, - "column": 15 - }, - "end": { - "line": 12, - "column": 16 - } - } + "value": ")" }, { "type": "Punctuator", @@ -1299,7 +1327,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 13, + "column": 0 + }, + "start": { + "line": 9, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -1375,19 +1412,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 268, 271 ], "loc": { - "start": { - "line": 15, - "column": 2 - }, "end": { "line": 15, "column": 5 + }, + "start": { + "line": 15, + "column": 2 } } }, @@ -1395,19 +1434,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 268, 271 ], "loc": { - "start": { - "line": 15, - "column": 2 - }, "end": { "line": 15, "column": 5 + }, + "start": { + "line": 15, + "column": 2 } } }, @@ -1601,219 +1642,219 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 36, - 37 - ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } - } + }, + "range": [ + 36, + 37 + ], + "value": "T" }, { "type": "Keyword", - "value": "extends", + "loc": { + "end": { + "line": 3, + "column": 11 + }, + "start": { + "line": 3, + "column": 4 + } + }, "range": [ 54, 61 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 4 + "column": 15 }, - "end": { + "start": { "line": 3, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 62, 65 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 3, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 65, 66 ], - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", - "range": [ - 85, - 86 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 85, + 86 + ], + "value": "U" }, { "type": "Keyword", - "value": "extends", - "range": [ - 106, - 113 - ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 11 + }, + "start": { + "line": 6, + "column": 4 } - } + }, + "range": [ + 106, + 113 + ], + "value": "extends" }, { "type": "Identifier", - "value": "Record", + "loc": { + "end": { + "line": 7, + "column": 10 + }, + "start": { + "line": 7, + "column": 4 + } + }, "range": [ 118, 124 ], + "value": "Record" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 4 + "column": 14 }, - "end": { + "start": { "line": 7, "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 124, 128 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 7, - "column": 10 + "column": 20 }, - "end": { + "start": { "line": 7, "column": 14 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 128, 134 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 14 + "column": 21 }, - "end": { + "start": { "line": 7, "column": 20 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 134, 135 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 7, - "column": 20 + "column": 23 }, - "end": { + "start": { "line": 7, - "column": 21 + "column": 22 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 136, 137 ], + "value": "T" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 22 + "column": 24 }, - "end": { + "start": { "line": 7, "column": 23 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 137, 138 ], - "loc": { - "start": { - "line": 7, - "column": 23 - }, - "end": { - "line": 7, - "column": 24 - } - } + "value": ">" }, { "type": "Punctuator", @@ -2609,21 +2650,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 268, - 271 - ], "loc": { - "start": { - "line": 15, - "column": 2 - }, "end": { "line": 15, "column": 5 + }, + "start": { + "line": 15, + "column": 2 } - } + }, + "range": [ + 268, + 271 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -2701,57 +2742,57 @@ "comments": [ { "type": "Line", - "value": " Comments", - "range": [ - 38, - 49 - ], "loc": { - "start": { - "line": 2, - "column": 4 - }, "end": { "line": 2, "column": 15 + }, + "start": { + "line": 2, + "column": 4 } - } + }, + "range": [ + 38, + 49 + ], + "value": " Comments" }, { "type": "Line", - "value": " Comments", - "range": [ - 71, - 82 - ], "loc": { - "start": { - "line": 4, - "column": 4 - }, "end": { "line": 4, "column": 15 + }, + "start": { + "line": 4, + "column": 4 } - } + }, + "range": [ + 71, + 82 + ], + "value": " Comments" }, { "type": "Block", - "value": " Comments ", - "range": [ - 87, - 101 - ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 18 + }, + "start": { + "line": 5, + "column": 4 } - } + }, + "range": [ + 87, + 101 + ], + "value": " Comments " } ], "errors": [] diff --git a/test/fixtures/ast/vue3.3-generic-6-with-default/ast.json b/test/fixtures/ast/vue3.3-generic-6-with-default/ast.json index 0c366303..df9f6fee 100644 --- a/test/fixtures/ast/vue3.3-generic-6-with-default/ast.json +++ b/test/fixtures/ast/vue3.3-generic-6-with-default/ast.json @@ -1,23 +1,30 @@ { "type": "Program", + "range": [ + 228, + 331 + ], "body": [ { "type": "TSTypeAliasDeclaration", + "declare": false, "id": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 233, 236 ], "loc": { - "start": { - "line": 14, - "column": 5 - }, "end": { "line": 14, "column": 8 + }, + "start": { + "line": 14, + "column": 5 } } }, @@ -31,13 +38,13 @@ 245 ], "loc": { - "start": { - "line": 14, - "column": 11 - }, "end": { "line": 14, "column": 17 + }, + "start": { + "line": 14, + "column": 11 } } }, @@ -48,13 +55,13 @@ 254 ], "loc": { - "start": { - "line": 14, - "column": 20 - }, "end": { "line": 14, "column": 26 + }, + "start": { + "line": 14, + "column": 20 } } } @@ -64,13 +71,13 @@ 254 ], "loc": { - "start": { - "line": 14, - "column": 11 - }, "end": { "line": 14, "column": 26 + }, + "start": { + "line": 14, + "column": 11 } } }, @@ -79,13 +86,13 @@ 254 ], "loc": { - "start": { - "line": 14, - "column": 0 - }, "end": { "line": 14, "column": 26 + }, + "start": { + "line": 14, + "column": 0 } } }, @@ -94,61 +101,52 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 261, 262 ], "loc": { - "start": { - "line": 15, - "column": 6 - }, "end": { "line": 15, "column": 7 + }, + "start": { + "line": 15, + "column": 6 } } }, "init": { "type": "CallExpression", + "arguments": [], "callee": { "type": "Identifier", + "decorators": [], "name": "defineProps", + "optional": false, "range": [ 265, 276 ], "loc": { - "start": { - "line": 15, - "column": 10 - }, "end": { "line": 15, "column": 21 + }, + "start": { + "line": 15, + "column": 10 } } }, - "arguments": [], "optional": false, - "range": [ - 265, - 295 - ], - "loc": { - "start": { - "line": 15, - "column": 10 - }, - "end": { - "line": 15, - "column": 40 - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 276, @@ -163,32 +161,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 278, 281 ], "loc": { - "start": { - "line": 15, - "column": 23 - }, "end": { "line": 15, "column": 26 + }, + "start": { + "line": 15, + "column": 23 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 15, - "column": 26 - }, "end": { "line": 15, "column": 28 + }, + "start": { + "line": 15, + "column": 26 } }, "range": [ @@ -199,19 +202,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 282, 283 ], "loc": { - "start": { - "line": 15, - "column": 27 - }, "end": { "line": 15, "column": 28 + }, + "start": { + "line": 15, + "column": 27 } } }, @@ -220,13 +225,13 @@ 283 ], "loc": { - "start": { - "line": 15, - "column": 27 - }, "end": { "line": 15, "column": 28 + }, + "start": { + "line": 15, + "column": 27 } } } @@ -236,13 +241,13 @@ 284 ], "loc": { - "start": { - "line": 15, - "column": 23 - }, "end": { "line": 15, "column": 29 + }, + "start": { + "line": 15, + "column": 23 } } }, @@ -251,32 +256,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "bar", + "optional": false, "range": [ 285, 288 ], "loc": { - "start": { - "line": 15, - "column": 30 - }, "end": { "line": 15, "column": 33 + }, + "start": { + "line": 15, + "column": 30 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 15, - "column": 33 - }, "end": { "line": 15, "column": 36 + }, + "start": { + "line": 15, + "column": 33 } }, "range": [ @@ -287,19 +297,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "U", + "optional": false, "range": [ 290, 291 ], "loc": { - "start": { - "line": 15, - "column": 35 - }, "end": { "line": 15, "column": 36 + }, + "start": { + "line": 15, + "column": 35 } } }, @@ -308,13 +320,13 @@ 291 ], "loc": { - "start": { - "line": 15, - "column": 35 - }, "end": { "line": 15, "column": 36 + }, + "start": { + "line": 15, + "column": 35 } } } @@ -324,13 +336,13 @@ 291 ], "loc": { - "start": { - "line": 15, - "column": 30 - }, "end": { "line": 15, "column": 36 + }, + "start": { + "line": 15, + "column": 30 } } } @@ -340,27 +352,41 @@ 292 ], "loc": { - "start": { - "line": 15, - "column": 22 - }, "end": { "line": 15, "column": 37 + }, + "start": { + "line": 15, + "column": 22 } } } ], "loc": { - "start": { - "line": 15, - "column": 21 - }, "end": { "line": 15, "column": 38 + }, + "start": { + "line": 15, + "column": 21 } } + }, + "range": [ + 265, + 295 + ], + "loc": { + "end": { + "line": 15, + "column": 40 + }, + "start": { + "line": 15, + "column": 10 + } } }, "range": [ @@ -368,30 +394,31 @@ 295 ], "loc": { - "start": { - "line": 15, - "column": 6 - }, "end": { "line": 15, "column": 40 + }, + "start": { + "line": 15, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 255, 295 ], "loc": { - "start": { - "line": 15, - "column": 0 - }, "end": { "line": 15, "column": 40 + }, + "start": { + "line": 15, + "column": 0 } } }, @@ -400,76 +427,83 @@ "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 302, 305 ], "loc": { - "start": { - "line": 16, - "column": 6 - }, "end": { "line": 16, "column": 9 + }, + "start": { + "line": 16, + "column": 6 } } }, "init": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 308, 309 ], "loc": { - "start": { - "line": 16, - "column": 12 - }, "end": { "line": 16, "column": 13 + }, + "start": { + "line": 16, + "column": 12 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 310, 313 ], "loc": { - "start": { - "line": 16, - "column": 14 - }, "end": { "line": 16, "column": 17 + }, + "start": { + "line": 16, + "column": 14 } } }, - "computed": false, - "optional": false, "range": [ 308, 313 ], "loc": { - "start": { - "line": 16, - "column": 12 - }, "end": { "line": 16, "column": 17 + }, + "start": { + "line": 16, + "column": 12 } } }, @@ -478,125 +512,132 @@ 313 ], "loc": { - "start": { - "line": 16, - "column": 6 - }, "end": { "line": 16, "column": 17 + }, + "start": { + "line": 16, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 296, 313 ], "loc": { - "start": { - "line": 16, - "column": 0 - }, "end": { "line": 16, "column": 17 - } - } - }, + }, + "start": { + "line": 16, + "column": 0 + } + } + }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "decorators": [], + "name": "foo", + "optional": false, + "range": [ + 326, + 329 + ], + "loc": { + "end": { + "line": 17, + "column": 15 + }, + "start": { + "line": 17, + "column": 12 + } + } + } + ], "callee": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "console", + "optional": false, "range": [ 314, 321 ], "loc": { - "start": { - "line": 17, - "column": 0 - }, "end": { "line": 17, "column": 7 + }, + "start": { + "line": 17, + "column": 0 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "log", + "optional": false, "range": [ 322, 325 ], "loc": { - "start": { - "line": 17, - "column": 8 - }, "end": { "line": 17, "column": 11 + }, + "start": { + "line": 17, + "column": 8 } } }, - "computed": false, - "optional": false, "range": [ 314, 325 ], "loc": { - "start": { - "line": 17, - "column": 0 - }, "end": { "line": 17, "column": 11 + }, + "start": { + "line": 17, + "column": 0 } } }, - "arguments": [ - { - "type": "Identifier", - "name": "foo", - "range": [ - 326, - 329 - ], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 15 - } - } - } - ], "optional": false, "range": [ 314, 330 ], "loc": { - "start": { - "line": 17, - "column": 0 - }, "end": { "line": 17, "column": 16 + }, + "start": { + "line": 17, + "column": 0 } } }, @@ -605,32 +646,19 @@ 330 ], "loc": { - "start": { - "line": 17, - "column": 0 - }, "end": { "line": 17, "column": 16 + }, + "start": { + "line": 17, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 228, - 331 - ], - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 18, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -652,633 +680,633 @@ }, { "type": "Identifier", - "value": "type", + "loc": { + "end": { + "line": 14, + "column": 4 + }, + "start": { + "line": 14, + "column": 0 + } + }, "range": [ 228, 232 ], + "value": "type" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 14, - "column": 0 + "column": 8 }, - "end": { + "start": { "line": 14, - "column": 4 + "column": 5 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 233, 236 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 14, - "column": 5 + "column": 10 }, - "end": { + "start": { "line": 14, - "column": 8 + "column": 9 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 237, 238 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 14, - "column": 9 + "column": 17 }, - "end": { + "start": { "line": 14, - "column": 10 + "column": 11 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 239, 245 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 14, - "column": 11 + "column": 19 }, - "end": { + "start": { "line": 14, - "column": 17 + "column": 18 } - } - }, - { - "type": "Punctuator", - "value": "|", + }, "range": [ 246, 247 ], + "value": "|" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 14, - "column": 18 + "column": 26 }, - "end": { + "start": { "line": 14, - "column": 19 + "column": 20 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 248, 254 ], - "loc": { - "start": { - "line": 14, - "column": 20 - }, - "end": { - "line": 14, - "column": 26 - } - } + "value": "string" }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 15, + "column": 5 + }, + "start": { + "line": 15, + "column": 0 + } + }, "range": [ 255, 260 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 15, - "column": 0 + "column": 7 }, - "end": { + "start": { "line": 15, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 261, 262 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 15, - "column": 6 + "column": 9 }, - "end": { + "start": { "line": 15, - "column": 7 + "column": 8 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 263, 264 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 15, - "column": 8 + "column": 21 }, - "end": { + "start": { "line": 15, - "column": 9 + "column": 10 } - } - }, - { - "type": "Identifier", - "value": "defineProps", + }, "range": [ 265, 276 ], + "value": "defineProps" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 15, - "column": 10 + "column": 22 }, - "end": { + "start": { "line": 15, "column": 21 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 276, 277 ], + "value": "<" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 15, - "column": 21 + "column": 23 }, - "end": { + "start": { "line": 15, "column": 22 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 277, 278 ], + "value": "{" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 15, - "column": 22 + "column": 26 }, - "end": { + "start": { "line": 15, "column": 23 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 278, 281 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 15, - "column": 23 + "column": 27 }, - "end": { + "start": { "line": 15, "column": 26 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 281, 282 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 15, - "column": 26 + "column": 28 }, - "end": { + "start": { "line": 15, "column": 27 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 282, 283 ], + "value": "T" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 15, - "column": 27 + "column": 29 }, - "end": { + "start": { "line": 15, "column": 28 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 283, 284 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 15, - "column": 28 + "column": 33 }, - "end": { + "start": { "line": 15, - "column": 29 + "column": 30 } - } - }, - { - "type": "Identifier", - "value": "bar", + }, "range": [ 285, 288 ], + "value": "bar" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 15, - "column": 30 + "column": 34 }, - "end": { + "start": { "line": 15, "column": 33 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 288, 289 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 15, - "column": 33 + "column": 36 }, - "end": { + "start": { "line": 15, - "column": 34 + "column": 35 } - } - }, - { - "type": "Identifier", - "value": "U", + }, "range": [ 290, 291 ], + "value": "U" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 15, - "column": 35 + "column": 37 }, - "end": { + "start": { "line": 15, "column": 36 } - } - }, - { - "type": "Punctuator", - "value": "}", + }, "range": [ 291, 292 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 15, - "column": 36 + "column": 38 }, - "end": { + "start": { "line": 15, "column": 37 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 292, 293 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 15, - "column": 37 + "column": 39 }, - "end": { + "start": { "line": 15, "column": 38 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 293, 294 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 15, - "column": 38 + "column": 40 }, - "end": { + "start": { "line": 15, "column": 39 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 294, 295 ], - "loc": { - "start": { - "line": 15, - "column": 39 - }, - "end": { - "line": 15, - "column": 40 - } - } + "value": ")" }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 16, + "column": 5 + }, + "start": { + "line": 16, + "column": 0 + } + }, "range": [ 296, 301 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 16, - "column": 0 + "column": 9 }, - "end": { + "start": { "line": 16, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 302, 305 ], + "value": "foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 16, - "column": 6 + "column": 11 }, - "end": { + "start": { "line": 16, - "column": 9 + "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 306, 307 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 16, - "column": 10 + "column": 13 }, - "end": { + "start": { "line": 16, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 308, 309 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 16, - "column": 12 + "column": 14 }, - "end": { + "start": { "line": 16, "column": 13 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 309, 310 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 16, - "column": 13 + "column": 17 }, - "end": { + "start": { "line": 16, "column": 14 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 310, 313 ], - "loc": { - "start": { - "line": 16, - "column": 14 - }, - "end": { - "line": 16, - "column": 17 - } - } + "value": "foo" }, { "type": "Identifier", - "value": "console", + "loc": { + "end": { + "line": 17, + "column": 7 + }, + "start": { + "line": 17, + "column": 0 + } + }, "range": [ 314, 321 ], + "value": "console" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 17, - "column": 0 + "column": 8 }, - "end": { + "start": { "line": 17, "column": 7 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 321, 322 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 17, - "column": 7 + "column": 11 }, - "end": { + "start": { "line": 17, "column": 8 } - } - }, - { - "type": "Identifier", - "value": "log", + }, "range": [ 322, 325 ], + "value": "log" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 17, - "column": 8 + "column": 12 }, - "end": { + "start": { "line": 17, "column": 11 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 325, 326 ], + "value": "(" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 17, - "column": 11 + "column": 15 }, - "end": { + "start": { "line": 17, "column": 12 } - } - }, - { - "type": "Identifier", - "value": "foo", + }, "range": [ 326, 329 ], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 15 - } - } + "value": "foo" }, { "type": "Punctuator", - "value": ")", - "range": [ - 329, - 330 - ], "loc": { - "start": { - "line": 17, - "column": 15 - }, "end": { "line": 17, "column": 16 + }, + "start": { + "line": 17, + "column": 15 } - } + }, + "range": [ + 329, + 330 + ], + "value": ")" }, { "type": "Punctuator", @@ -1299,7 +1327,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 18, + "column": 0 + }, + "start": { + "line": 14, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -1375,19 +1412,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 354, 357 ], "loc": { - "start": { - "line": 20, - "column": 2 - }, "end": { "line": 20, "column": 5 + }, + "start": { + "line": 20, + "column": 2 } } }, @@ -1395,19 +1434,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 354, 357 ], "loc": { - "start": { - "line": 20, - "column": 2 - }, "end": { "line": 20, "column": 5 + }, + "start": { + "line": 20, + "column": 2 } } }, @@ -1601,381 +1642,381 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 36, - 37 - ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } - } + }, + "range": [ + 36, + 37 + ], + "value": "T" }, { "type": "Keyword", - "value": "extends", + "loc": { + "end": { + "line": 3, + "column": 11 + }, + "start": { + "line": 3, + "column": 4 + } + }, "range": [ 54, 61 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 4 + "column": 23 }, - "end": { + "start": { "line": 3, - "column": 11 + "column": 20 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 70, 73 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 20 + "column": 25 }, - "end": { + "start": { "line": 3, - "column": 23 + "column": 24 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 74, 75 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 24 + "column": 32 }, - "end": { + "start": { "line": 3, - "column": 25 + "column": 26 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 76, 82 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 26 + "column": 33 }, - "end": { + "start": { "line": 3, "column": 32 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 82, 83 ], - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 33 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", - "range": [ - 102, - 103 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 102, + 103 + ], + "value": "U" }, { "type": "Keyword", - "value": "extends", - "range": [ - 122, - 129 - ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 11 + }, + "start": { + "line": 6, + "column": 4 } - } + }, + "range": [ + 122, + 129 + ], + "value": "extends" }, { "type": "Identifier", - "value": "Record", + "loc": { + "end": { + "line": 7, + "column": 10 + }, + "start": { + "line": 7, + "column": 4 + } + }, "range": [ 134, 140 ], + "value": "Record" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 4 + "column": 14 }, - "end": { + "start": { "line": 7, "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 140, 144 ], - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 14 - } - } + "value": "<" }, { "type": "Identifier", - "value": "string", + "loc": { + "end": { + "line": 9, + "column": 12 + }, + "start": { + "line": 9, + "column": 6 + } + }, "range": [ 165, 171 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 6 + "column": 13 }, - "end": { + "start": { "line": 9, "column": 12 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 171, 172 ], - "loc": { - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 9, - "column": 13 - } - } + "value": "," }, { "type": "Identifier", - "value": "T", - "range": [ - 184, - 185 - ], "loc": { - "start": { - "line": 10, - "column": 6 - }, "end": { "line": 10, "column": 7 + }, + "start": { + "line": 10, + "column": 6 } - } + }, + "range": [ + 184, + 185 + ], + "value": "T" }, { "type": "Punctuator", - "value": ">", - "range": [ - 190, - 191 - ], "loc": { - "start": { - "line": 11, - "column": 4 - }, "end": { "line": 11, "column": 5 + }, + "start": { + "line": 11, + "column": 4 } - } + }, + "range": [ + 190, + 191 + ], + "value": ">" }, { "type": "Punctuator", - "value": "=", + "loc": { + "end": { + "line": 12, + "column": 6 + }, + "start": { + "line": 12, + "column": 5 + } + }, "range": [ 197, 198 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 5 + "column": 13 }, - "end": { + "start": { "line": 12, - "column": 6 + "column": 7 } - } - }, - { - "type": "Identifier", - "value": "Record", + }, "range": [ 199, 205 ], + "value": "Record" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 7 + "column": 14 }, - "end": { + "start": { "line": 12, "column": 13 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 205, 206 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 13 + "column": 20 }, - "end": { + "start": { "line": 12, "column": 14 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 206, 212 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 14 + "column": 21 }, - "end": { + "start": { "line": 12, "column": 20 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 212, 213 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 20 + "column": 28 }, - "end": { + "start": { "line": 12, - "column": 21 + "column": 22 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 214, 220 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 22 + "column": 32 }, - "end": { + "start": { "line": 12, "column": 28 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 220, 224 ], - "loc": { - "start": { - "line": 12, - "column": 28 - }, - "end": { - "line": 12, - "column": 32 - } - } + "value": ">" }, { "type": "Punctuator", @@ -2771,21 +2812,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 354, - 357 - ], "loc": { - "start": { - "line": 20, - "column": 2 - }, "end": { "line": 20, "column": 5 + }, + "start": { + "line": 20, + "column": 2 } - } + }, + "range": [ + 354, + 357 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -2863,111 +2904,111 @@ "comments": [ { "type": "Line", - "value": " Comments", - "range": [ - 38, - 49 - ], "loc": { - "start": { - "line": 2, - "column": 4 - }, "end": { "line": 2, "column": 15 + }, + "start": { + "line": 2, + "column": 4 } - } + }, + "range": [ + 38, + 49 + ], + "value": " Comments" }, { "type": "Block", - "value": " = ", - "range": [ - 62, - 69 - ], "loc": { - "start": { - "line": 3, - "column": 12 - }, "end": { "line": 3, "column": 19 + }, + "start": { + "line": 3, + "column": 12 } - } + }, + "range": [ + 62, + 69 + ], + "value": " = " }, { "type": "Line", - "value": " Comments", - "range": [ - 88, - 99 - ], "loc": { - "start": { - "line": 4, - "column": 4 - }, "end": { "line": 4, "column": 15 + }, + "start": { + "line": 4, + "column": 4 } - } + }, + "range": [ + 88, + 99 + ], + "value": " Comments" }, { "type": "Block", - "value": " extends ", - "range": [ - 104, - 117 - ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 17 + }, + "start": { + "line": 5, + "column": 4 } - } + }, + "range": [ + 104, + 117 + ], + "value": " extends " }, { "type": "Block", - "value": " = ", - "range": [ - 151, - 158 - ], "loc": { - "start": { - "line": 8, - "column": 6 - }, "end": { "line": 8, "column": 13 + }, + "start": { + "line": 8, + "column": 6 } - } + }, + "range": [ + 151, + 158 + ], + "value": " = " }, { "type": "Line", - "value": " =", - "range": [ - 173, - 177 - ], "loc": { - "start": { - "line": 9, - "column": 14 - }, "end": { "line": 9, "column": 18 + }, + "start": { + "line": 9, + "column": 14 } - } + }, + "range": [ + 173, + 177 + ], + "value": " =" } ], "errors": [] diff --git a/test/fixtures/ast/vue3.3-generic-7-with-arrow/ast.json b/test/fixtures/ast/vue3.3-generic-7-with-arrow/ast.json index a08b871e..f79be40c 100644 --- a/test/fixtures/ast/vue3.3-generic-7-with-arrow/ast.json +++ b/test/fixtures/ast/vue3.3-generic-7-with-arrow/ast.json @@ -1,66 +1,61 @@ { "type": "Program", + "range": [ + 103, + 141 + ], "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", + "definite": false, "id": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 109, 110 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 7 + }, + "start": { + "line": 5, + "column": 6 } } }, "init": { "type": "CallExpression", + "arguments": [], "callee": { "type": "Identifier", + "decorators": [], "name": "defineProps", + "optional": false, "range": [ 113, 124 ], "loc": { - "start": { - "line": 5, - "column": 10 - }, "end": { "line": 5, "column": 21 + }, + "start": { + "line": 5, + "column": 10 } } }, - "arguments": [], "optional": false, - "range": [ - 113, - 140 - ], - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 37 - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 124, @@ -75,32 +70,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "t", + "optional": false, "range": [ 126, 127 ], "loc": { - "start": { - "line": 5, - "column": 23 - }, "end": { "line": 5, "column": 24 + }, + "start": { + "line": 5, + "column": 23 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 5, - "column": 24 - }, "end": { "line": 5, "column": 27 + }, + "start": { + "line": 5, + "column": 24 } }, "range": [ @@ -111,19 +111,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 129, 130 ], "loc": { - "start": { - "line": 5, - "column": 26 - }, "end": { "line": 5, "column": 27 + }, + "start": { + "line": 5, + "column": 26 } } }, @@ -132,13 +134,13 @@ 130 ], "loc": { - "start": { - "line": 5, - "column": 26 - }, "end": { "line": 5, "column": 27 + }, + "start": { + "line": 5, + "column": 26 } } } @@ -148,13 +150,13 @@ 131 ], "loc": { - "start": { - "line": 5, - "column": 23 - }, "end": { "line": 5, "column": 28 + }, + "start": { + "line": 5, + "column": 23 } } }, @@ -163,32 +165,37 @@ "computed": false, "key": { "type": "Identifier", + "decorators": [], "name": "u", + "optional": false, "range": [ 132, 133 ], "loc": { - "start": { - "line": 5, - "column": 29 - }, "end": { "line": 5, "column": 30 + }, + "start": { + "line": 5, + "column": 29 } } }, + "optional": false, + "readonly": false, + "static": false, "typeAnnotation": { "type": "TSTypeAnnotation", "loc": { - "start": { - "line": 5, - "column": 30 - }, "end": { "line": 5, "column": 33 + }, + "start": { + "line": 5, + "column": 30 } }, "range": [ @@ -199,19 +206,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "U", + "optional": false, "range": [ 135, 136 ], "loc": { - "start": { - "line": 5, - "column": 32 - }, "end": { "line": 5, "column": 33 + }, + "start": { + "line": 5, + "column": 32 } } }, @@ -220,13 +229,13 @@ 136 ], "loc": { - "start": { - "line": 5, - "column": 32 - }, "end": { "line": 5, "column": 33 + }, + "start": { + "line": 5, + "column": 32 } } } @@ -236,13 +245,13 @@ 136 ], "loc": { - "start": { - "line": 5, - "column": 29 - }, "end": { "line": 5, "column": 33 + }, + "start": { + "line": 5, + "column": 29 } } } @@ -252,27 +261,41 @@ 137 ], "loc": { - "start": { - "line": 5, - "column": 22 - }, "end": { "line": 5, "column": 34 + }, + "start": { + "line": 5, + "column": 22 } } } ], "loc": { - "start": { - "line": 5, - "column": 21 - }, "end": { "line": 5, "column": 35 + }, + "start": { + "line": 5, + "column": 21 } } + }, + "range": [ + 113, + 140 + ], + "loc": { + "end": { + "line": 5, + "column": 37 + }, + "start": { + "line": 5, + "column": 10 + } } }, "range": [ @@ -280,49 +303,37 @@ 140 ], "loc": { - "start": { - "line": 5, - "column": 6 - }, "end": { "line": 5, "column": 37 + }, + "start": { + "line": 5, + "column": 6 } } } ], + "declare": false, "kind": "const", "range": [ 103, 140 ], "loc": { - "start": { - "line": 5, - "column": 0 - }, "end": { "line": 5, "column": 37 + }, + "start": { + "line": 5, + "column": 0 } } } ], + "comments": [], "sourceType": "module", - "range": [ - 103, - 141 - ], - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 6, - "column": 0 - } - }, "tokens": [ { "type": "Punctuator", @@ -344,309 +355,309 @@ }, { "type": "Keyword", - "value": "const", + "loc": { + "end": { + "line": 5, + "column": 5 + }, + "start": { + "line": 5, + "column": 0 + } + }, "range": [ 103, 108 ], + "value": "const" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 0 + "column": 7 }, - "end": { + "start": { "line": 5, - "column": 5 + "column": 6 } - } - }, - { - "type": "Identifier", - "value": "p", + }, "range": [ 109, 110 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 6 + "column": 9 }, - "end": { + "start": { "line": 5, - "column": 7 + "column": 8 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 111, 112 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 8 + "column": 21 }, - "end": { + "start": { "line": 5, - "column": 9 + "column": 10 } - } - }, - { - "type": "Identifier", - "value": "defineProps", + }, "range": [ 113, 124 ], + "value": "defineProps" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 10 + "column": 22 }, - "end": { + "start": { "line": 5, "column": 21 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 124, 125 ], + "value": "<" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 21 + "column": 23 }, - "end": { + "start": { "line": 5, "column": 22 } - } - }, - { - "type": "Punctuator", - "value": "{", + }, "range": [ 125, 126 ], + "value": "{" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 22 + "column": 24 }, - "end": { + "start": { "line": 5, "column": 23 } - } - }, - { - "type": "Identifier", - "value": "t", + }, "range": [ 126, 127 ], + "value": "t" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 23 + "column": 25 }, - "end": { + "start": { "line": 5, "column": 24 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 127, 128 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 24 + "column": 27 }, - "end": { + "start": { "line": 5, - "column": 25 + "column": 26 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 129, 130 ], + "value": "T" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 26 + "column": 28 }, - "end": { + "start": { "line": 5, "column": 27 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 130, 131 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 27 + "column": 30 }, - "end": { + "start": { "line": 5, - "column": 28 + "column": 29 } - } - }, - { - "type": "Identifier", - "value": "u", + }, "range": [ 132, 133 ], + "value": "u" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 29 + "column": 31 }, - "end": { + "start": { "line": 5, "column": 30 } - } - }, - { - "type": "Punctuator", - "value": ":", + }, "range": [ 133, 134 ], + "value": ":" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 5, - "column": 30 + "column": 33 }, - "end": { + "start": { "line": 5, - "column": 31 + "column": 32 } - } - }, - { - "type": "Identifier", - "value": "U", + }, "range": [ 135, 136 ], + "value": "U" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 32 + "column": 34 }, - "end": { + "start": { "line": 5, "column": 33 } - } - }, - { - "type": "Punctuator", - "value": "}", + }, "range": [ 136, 137 ], + "value": "}" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 33 + "column": 35 }, - "end": { + "start": { "line": 5, "column": 34 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 137, 138 ], + "value": ">" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 34 + "column": 36 }, - "end": { + "start": { "line": 5, "column": 35 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 138, 139 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 5, - "column": 35 + "column": 37 }, - "end": { + "start": { "line": 5, "column": 36 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 139, 140 ], - "loc": { - "start": { - "line": 5, - "column": 36 - }, - "end": { - "line": 5, - "column": 37 - } - } + "value": ")" }, { "type": "Punctuator", @@ -667,7 +678,16 @@ "value": "" } ], - "comments": [], + "loc": { + "end": { + "line": 6, + "column": 0 + }, + "start": { + "line": 5, + "column": 0 + } + }, "templateBody": { "type": "VElement", "range": [ @@ -743,75 +763,79 @@ }, "expression": { "type": "CallExpression", + "arguments": [], "callee": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 165, 166 ], "loc": { - "start": { - "line": 9, - "column": 2 - }, "end": { "line": 9, "column": 3 + }, + "start": { + "line": 9, + "column": 2 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "t", + "optional": false, "range": [ 167, 168 ], "loc": { - "start": { - "line": 9, - "column": 4 - }, "end": { "line": 9, "column": 5 + }, + "start": { + "line": 9, + "column": 4 } } }, - "computed": false, - "optional": false, "range": [ 165, 168 - ], - "loc": { - "start": { - "line": 9, - "column": 2 - }, + ], + "loc": { "end": { "line": 9, "column": 5 + }, + "start": { + "line": 9, + "column": 2 } } }, - "arguments": [], "optional": false, "range": [ 165, 170 ], "loc": { - "start": { - "line": 9, - "column": 2 - }, "end": { "line": 9, "column": 7 + }, + "start": { + "line": 9, + "column": 2 } } }, @@ -819,19 +843,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 165, 166 ], "loc": { - "start": { - "line": 9, - "column": 2 - }, "end": { "line": 9, "column": 3 + }, + "start": { + "line": 9, + "column": 2 } } }, @@ -877,75 +903,79 @@ }, "expression": { "type": "CallExpression", + "arguments": [], "callee": { "type": "MemberExpression", + "computed": false, "object": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 175, 176 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 3 + }, + "start": { + "line": 10, + "column": 2 } } }, + "optional": false, "property": { "type": "Identifier", + "decorators": [], "name": "u", + "optional": false, "range": [ 177, 178 ], "loc": { - "start": { - "line": 10, - "column": 4 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 4 } } }, - "computed": false, - "optional": false, "range": [ 175, 178 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } } }, - "arguments": [], "optional": false, "range": [ 175, 180 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 7 + }, + "start": { + "line": 10, + "column": 2 } } }, @@ -953,19 +983,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "p", + "optional": false, "range": [ 175, 176 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 3 + }, + "start": { + "line": 10, + "column": 2 } } }, @@ -1159,327 +1191,327 @@ }, { "type": "Identifier", - "value": "T", + "loc": { + "end": { + "line": 2, + "column": 3 + }, + "start": { + "line": 2, + "column": 2 + } + }, "range": [ 36, 37 ], + "value": "T" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 2, - "column": 2 + "column": 11 }, - "end": { + "start": { "line": 2, - "column": 3 + "column": 4 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 38, 45 ], + "value": "extends" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 4 + "column": 13 }, - "end": { + "start": { "line": 2, - "column": 11 + "column": 12 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 46, 47 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 12 + "column": 14 }, - "end": { + "start": { "line": 2, "column": 13 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 47, 48 ], + "value": ")" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 13 + "column": 17 }, - "end": { + "start": { "line": 2, - "column": 14 + "column": 15 } - } - }, - { - "type": "Punctuator", - "value": "=>", + }, "range": [ 49, 51 ], + "value": "=>" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 15 + "column": 24 }, - "end": { + "start": { "line": 2, - "column": 17 + "column": 18 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 52, 58 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 18 + "column": 25 }, - "end": { + "start": { "line": 2, "column": 24 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 58, 59 ], - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", + "loc": { + "end": { + "line": 3, + "column": 3 + }, + "start": { + "line": 3, + "column": 2 + } + }, "range": [ 62, 63 ], + "value": "U" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 3, - "column": 2 + "column": 12 }, - "end": { + "start": { "line": 3, - "column": 3 + "column": 5 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 65, 72 ], + "value": "extends" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 5 + "column": 14 }, - "end": { + "start": { "line": 3, - "column": 12 + "column": 13 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 73, 74 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 13 + "column": 15 }, - "end": { + "start": { "line": 3, "column": 14 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 74, 75 ], + "value": ")" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 14 + "column": 18 }, - "end": { + "start": { "line": 3, - "column": 15 + "column": 16 } - } - }, - { - "type": "Punctuator", - "value": "=>", + }, "range": [ 76, 78 ], + "value": "=>" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 16 + "column": 25 }, - "end": { + "start": { "line": 3, - "column": 18 + "column": 19 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 79, 85 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 19 + "column": 27 }, - "end": { + "start": { "line": 3, - "column": 25 + "column": 26 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 86, 87 ], + "value": "=" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 26 + "column": 29 }, - "end": { + "start": { "line": 3, - "column": 27 + "column": 28 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 88, 89 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 28 + "column": 30 }, - "end": { + "start": { "line": 3, "column": 29 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 89, 90 ], + "value": ")" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 29 + "column": 33 }, - "end": { + "start": { "line": 3, - "column": 30 + "column": 31 } - } - }, - { - "type": "Punctuator", - "value": "=>", + }, "range": [ 91, 93 ], + "value": "=>" + }, + { + "type": "String", "loc": { - "start": { + "end": { "line": 3, - "column": 31 + "column": 39 }, - "end": { + "start": { "line": 3, - "column": 33 + "column": 34 } - } - }, - { - "type": "String", - "value": "'abc'", + }, "range": [ 94, 99 ], - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 39 - } - } + "value": "'abc'" }, { "type": "Punctuator", @@ -1915,93 +1947,93 @@ }, { "type": "Identifier", - "value": "p", + "loc": { + "end": { + "line": 9, + "column": 3 + }, + "start": { + "line": 9, + "column": 2 + } + }, "range": [ 165, 166 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 2 + "column": 4 }, - "end": { + "start": { "line": 9, "column": 3 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 166, 167 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 3 + "column": 5 }, - "end": { + "start": { "line": 9, "column": 4 } - } - }, - { - "type": "Identifier", - "value": "t", + }, "range": [ 167, 168 ], + "value": "t" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 4 + "column": 6 }, - "end": { + "start": { "line": 9, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 168, 169 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 5 + "column": 7 }, - "end": { + "start": { "line": 9, "column": 6 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 169, 170 ], - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 7 - } - } + "value": ")" }, { "type": "VExpressionEnd", @@ -2059,93 +2091,93 @@ }, { "type": "Identifier", - "value": "p", + "loc": { + "end": { + "line": 10, + "column": 3 + }, + "start": { + "line": 10, + "column": 2 + } + }, "range": [ 175, 176 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 2 + "column": 4 }, - "end": { + "start": { "line": 10, "column": 3 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 176, 177 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 3 + "column": 5 }, - "end": { + "start": { "line": 10, "column": 4 } - } - }, - { - "type": "Identifier", - "value": "u", + }, "range": [ 177, 178 ], + "value": "u" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 4 + "column": 6 }, - "end": { + "start": { "line": 10, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 178, 179 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 5 + "column": 7 }, - "end": { + "start": { "line": 10, "column": 6 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 179, 180 ], - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 7 - } - } + "value": ")" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/document-fragment/style-variables-edge-cases/document-fragment.json b/test/fixtures/document-fragment/style-variables-edge-cases/document-fragment.json index 9d703376..8616cb4e 100644 --- a/test/fixtures/document-fragment/style-variables-edge-cases/document-fragment.json +++ b/test/fixtures/document-fragment/style-variables-edge-cases/document-fragment.json @@ -226,7 +226,8 @@ ], "name": "size" }, - "computed": false + "computed": false, + "optional": false }, "references": [ { @@ -348,7 +349,8 @@ "value": "color", "raw": "'color'" } - ] + ], + "optional": false }, "references": [ { @@ -468,7 +470,8 @@ ], "name": "color" }, - "computed": false + "computed": false, + "optional": false }, "references": [ { diff --git a/test/fixtures/document-fragment/style-variables-ignores02/document-fragment.json b/test/fixtures/document-fragment/style-variables-ignores02/document-fragment.json index 187cd4d5..06625d92 100644 --- a/test/fixtures/document-fragment/style-variables-ignores02/document-fragment.json +++ b/test/fixtures/document-fragment/style-variables-ignores02/document-fragment.json @@ -283,7 +283,8 @@ "value": 42, "raw": "42" }, - "computed": true + "computed": true, + "optional": false }, "references": [ { @@ -383,7 +384,8 @@ ], "name": "getColor" }, - "arguments": [] + "arguments": [], + "optional": false }, "references": [ { diff --git a/test/fixtures/document-fragment/style-variables01/document-fragment.json b/test/fixtures/document-fragment/style-variables01/document-fragment.json index 1812ac76..e920516a 100644 --- a/test/fixtures/document-fragment/style-variables01/document-fragment.json +++ b/test/fixtures/document-fragment/style-variables01/document-fragment.json @@ -2361,7 +2361,8 @@ ], "name": "size" }, - "computed": false + "computed": false, + "optional": false }, "references": [ { diff --git a/test/fixtures/document-fragment/style-variables02/document-fragment.json b/test/fixtures/document-fragment/style-variables02/document-fragment.json index 167b24f4..10654bb7 100644 --- a/test/fixtures/document-fragment/style-variables02/document-fragment.json +++ b/test/fixtures/document-fragment/style-variables02/document-fragment.json @@ -244,7 +244,8 @@ ], "name": "font" }, - "computed": false + "computed": false, + "optional": false }, "property": { "type": "Identifier", @@ -266,7 +267,8 @@ ], "name": "size" }, - "computed": false + "computed": false, + "optional": false }, "references": [ { diff --git a/test/fixtures/document-fragment/style-variables05/document-fragment.json b/test/fixtures/document-fragment/style-variables05/document-fragment.json index 58b12495..6c733b31 100644 --- a/test/fixtures/document-fragment/style-variables05/document-fragment.json +++ b/test/fixtures/document-fragment/style-variables05/document-fragment.json @@ -226,7 +226,8 @@ ], "name": "size" }, - "computed": false + "computed": false, + "optional": false }, "references": [ { @@ -348,7 +349,8 @@ "value": "color", "raw": "'color'" } - ] + ], + "optional": false }, "references": [ { @@ -468,7 +470,8 @@ ], "name": "color" }, - "computed": false + "computed": false, + "optional": false }, "references": [ { diff --git a/test/fixtures/document-fragment/vue3.3-generic-1/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-1/document-fragment.json index b354feda..13c2a968 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-1/document-fragment.json +++ b/test/fixtures/document-fragment/vue3.3-generic-1/document-fragment.json @@ -235,39 +235,41 @@ "params": [ { "type": "TSTypeParameter", + "const": false, + "in": false, "name": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 33, 34 ], "loc": { - "start": { - "line": 1, - "column": 33 - }, "end": { "line": 1, "column": 34 + }, + "start": { + "line": 1, + "column": 33 } } }, - "in": false, "out": false, - "const": false, "range": [ 33, 34 ], "loc": { - "start": { - "line": 1, - "column": 33 - }, "end": { "line": 1, "column": 34 + }, + "start": { + "line": 1, + "column": 33 } } } @@ -322,19 +324,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 33, 34 ], "loc": { - "start": { - "line": 1, - "column": 33 - }, "end": { "line": 1, "column": 34 + }, + "start": { + "line": 1, + "column": 33 } } }, @@ -435,19 +439,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 83, 86 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 2 } } }, @@ -455,19 +461,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 83, 86 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 2 } } }, @@ -661,21 +669,21 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 33, - 34 - ], "loc": { - "start": { - "line": 1, - "column": 33 - }, "end": { "line": 1, "column": 34 + }, + "start": { + "line": 1, + "column": 33 } - } + }, + "range": [ + 33, + 34 + ], + "value": "T" }, { "type": "Punctuator", @@ -895,21 +903,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 83, - 86 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 83, + 86 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -1135,21 +1143,21 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 33, - 34 - ], "loc": { - "start": { - "line": 1, - "column": 33 - }, "end": { "line": 1, "column": 34 + }, + "start": { + "line": 1, + "column": 33 } - } + }, + "range": [ + 33, + 34 + ], + "value": "T" }, { "type": "Punctuator", @@ -1369,21 +1377,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 83, - 86 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 5 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 83, + 86 + ], + "value": "foo" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/document-fragment/vue3.3-generic-2/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-2/document-fragment.json index efd5dc1c..370d495c 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-2/document-fragment.json +++ b/test/fixtures/document-fragment/vue3.3-generic-2/document-fragment.json @@ -330,41 +330,26 @@ "params": [ { "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "range": [ - 79, - 80 - ], - "loc": { - "start": { - "line": 4, - "column": 33 - }, - "end": { - "line": 4, - "column": 34 - } - } - }, + "const": false, "constraint": { "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 89, 92 ], "loc": { - "start": { - "line": 4, - "column": 43 - }, "end": { "line": 4, "column": 46 + }, + "start": { + "line": 4, + "column": 43 } } }, @@ -373,31 +358,50 @@ 92 ], "loc": { + "end": { + "line": 4, + "column": 46 + }, "start": { "line": 4, "column": 43 - }, + } + } + }, + "in": false, + "name": { + "type": "Identifier", + "decorators": [], + "name": "T", + "optional": false, + "range": [ + 79, + 80 + ], + "loc": { "end": { "line": 4, - "column": 46 + "column": 34 + }, + "start": { + "line": 4, + "column": 33 } } }, - "in": false, "out": false, - "const": false, "range": [ 79, 92 ], "loc": { - "start": { - "line": 4, - "column": 33 - }, "end": { "line": 4, "column": 46 + }, + "start": { + "line": 4, + "column": 33 } } } @@ -410,19 +414,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 89, 92 ], "loc": { - "start": { - "line": 4, - "column": 43 - }, "end": { "line": 4, "column": 46 + }, + "start": { + "line": 4, + "column": 43 } } }, @@ -476,19 +482,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 79, 80 ], "loc": { - "start": { - "line": 4, - "column": 33 - }, "end": { "line": 4, "column": 34 + }, + "start": { + "line": 4, + "column": 33 } } }, @@ -589,19 +597,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 186, 189 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } } }, @@ -609,19 +619,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 186, 189 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } } }, @@ -1139,57 +1151,57 @@ }, { "type": "Identifier", - "value": "T", + "loc": { + "end": { + "line": 4, + "column": 34 + }, + "start": { + "line": 4, + "column": 33 + } + }, "range": [ 79, 80 ], + "value": "T" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 4, - "column": 33 + "column": 42 }, - "end": { + "start": { "line": 4, - "column": 34 + "column": 35 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 81, 88 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 35 + "column": 46 }, - "end": { + "start": { "line": 4, - "column": 42 + "column": 43 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 89, 92 ], - "loc": { - "start": { - "line": 4, - "column": 43 - }, - "end": { - "line": 4, - "column": 46 - } - } + "value": "Foo" }, { "type": "Punctuator", @@ -1697,21 +1709,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 186, - 189 - ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } - } + }, + "range": [ + 186, + 189 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -2261,57 +2273,57 @@ }, { "type": "Identifier", - "value": "T", + "loc": { + "end": { + "line": 4, + "column": 34 + }, + "start": { + "line": 4, + "column": 33 + } + }, "range": [ 79, 80 ], + "value": "T" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 4, - "column": 33 + "column": 42 }, - "end": { + "start": { "line": 4, - "column": 34 + "column": 35 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 81, 88 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 35 + "column": 46 }, - "end": { + "start": { "line": 4, - "column": 42 + "column": 43 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 89, 92 ], - "loc": { - "start": { - "line": 4, - "column": 43 - }, - "end": { - "line": 4, - "column": 46 - } - } + "value": "Foo" }, { "type": "Punctuator", @@ -2819,21 +2831,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 186, - 189 - ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } - } + }, + "range": [ + 186, + 189 + ], + "value": "foo" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/document-fragment/vue3.3-generic-2/tree.json b/test/fixtures/document-fragment/vue3.3-generic-2/tree.json index c55894cd..02563812 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-2/tree.json +++ b/test/fixtures/document-fragment/vue3.3-generic-2/tree.json @@ -91,11 +91,6 @@ "type": "TSTypeParameter", "text": "T extends Foo", "children": [ - { - "type": "Identifier", - "text": "T", - "children": [] - }, { "type": "TSTypeReference", "text": "Foo", @@ -106,6 +101,11 @@ "children": [] } ] + }, + { + "type": "Identifier", + "text": "T", + "children": [] } ] } diff --git a/test/fixtures/document-fragment/vue3.3-generic-3/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-3/document-fragment.json index f3bedad1..352fa378 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-3/document-fragment.json +++ b/test/fixtures/document-fragment/vue3.3-generic-3/document-fragment.json @@ -330,41 +330,26 @@ "params": [ { "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "range": [ - 79, - 80 - ], - "loc": { - "start": { - "line": 4, - "column": 33 - }, - "end": { - "line": 4, - "column": 34 - } - } - }, + "const": false, "constraint": { "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 89, 92 ], "loc": { - "start": { - "line": 4, - "column": 43 - }, "end": { "line": 4, "column": 46 + }, + "start": { + "line": 4, + "column": 43 } } }, @@ -373,71 +358,75 @@ 92 ], "loc": { + "end": { + "line": 4, + "column": 46 + }, "start": { "line": 4, "column": 43 - }, + } + } + }, + "in": false, + "name": { + "type": "Identifier", + "decorators": [], + "name": "T", + "optional": false, + "range": [ + 79, + 80 + ], + "loc": { "end": { "line": 4, - "column": 46 + "column": 34 + }, + "start": { + "line": 4, + "column": 33 } } }, - "in": false, "out": false, - "const": false, "range": [ 79, 92 ], "loc": { - "start": { - "line": 4, - "column": 33 - }, "end": { "line": 4, "column": 46 + }, + "start": { + "line": 4, + "column": 33 } } }, { "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "range": [ - 94, - 95 - ], - "loc": { - "start": { - "line": 4, - "column": 48 - }, - "end": { - "line": 4, - "column": 49 - } - } - }, + "const": false, "constraint": { "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 104, 105 ], "loc": { - "start": { - "line": 4, - "column": 58 - }, "end": { "line": 4, "column": 59 + }, + "start": { + "line": 4, + "column": 58 } } }, @@ -446,31 +435,50 @@ 105 ], "loc": { + "end": { + "line": 4, + "column": 59 + }, "start": { "line": 4, "column": 58 - }, + } + } + }, + "in": false, + "name": { + "type": "Identifier", + "decorators": [], + "name": "U", + "optional": false, + "range": [ + 94, + 95 + ], + "loc": { "end": { "line": 4, - "column": 59 + "column": 49 + }, + "start": { + "line": 4, + "column": 48 } } }, - "in": false, "out": false, - "const": false, "range": [ 94, 105 ], "loc": { - "start": { - "line": 4, - "column": 48 - }, "end": { "line": 4, "column": 59 + }, + "start": { + "line": 4, + "column": 48 } } } @@ -484,19 +492,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 89, 92 ], "loc": { - "start": { - "line": 4, - "column": 43 - }, "end": { "line": 4, "column": 46 + }, + "start": { + "line": 4, + "column": 43 } } }, @@ -550,19 +560,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 79, 80 ], "loc": { - "start": { - "line": 4, - "column": 33 - }, "end": { "line": 4, "column": 34 + }, + "start": { + "line": 4, + "column": 33 } } }, @@ -571,19 +583,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "U", + "optional": false, "range": [ 94, 95 ], "loc": { - "start": { - "line": 4, - "column": 48 - }, "end": { "line": 4, "column": 49 + }, + "start": { + "line": 4, + "column": 48 } } }, @@ -684,19 +698,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 207, 210 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } } }, @@ -704,19 +720,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 207, 210 ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } } }, @@ -1234,129 +1252,129 @@ }, { "type": "Identifier", - "value": "T", + "loc": { + "end": { + "line": 4, + "column": 34 + }, + "start": { + "line": 4, + "column": 33 + } + }, "range": [ 79, 80 ], + "value": "T" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 4, - "column": 33 + "column": 42 }, - "end": { + "start": { "line": 4, - "column": 34 + "column": 35 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 81, 88 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 35 + "column": 46 }, - "end": { + "start": { "line": 4, - "column": 42 + "column": 43 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 89, 92 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 4, - "column": 43 + "column": 47 }, - "end": { + "start": { "line": 4, "column": 46 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 92, 93 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 46 + "column": 49 }, - "end": { + "start": { "line": 4, - "column": 47 + "column": 48 } - } - }, - { - "type": "Identifier", - "value": "U", + }, "range": [ 94, 95 ], + "value": "U" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 4, - "column": 48 + "column": 57 }, - "end": { + "start": { "line": 4, - "column": 49 + "column": 50 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 96, 103 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 50 + "column": 59 }, - "end": { + "start": { "line": 4, - "column": 57 + "column": 58 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 104, 105 ], - "loc": { - "start": { - "line": 4, - "column": 58 - }, - "end": { - "line": 4, - "column": 59 - } - } + "value": "T" }, { "type": "Punctuator", @@ -1936,21 +1954,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 207, - 210 - ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } - } + }, + "range": [ + 207, + 210 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -2500,129 +2518,129 @@ }, { "type": "Identifier", - "value": "T", + "loc": { + "end": { + "line": 4, + "column": 34 + }, + "start": { + "line": 4, + "column": 33 + } + }, "range": [ 79, 80 ], + "value": "T" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 4, - "column": 33 + "column": 42 }, - "end": { + "start": { "line": 4, - "column": 34 + "column": 35 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 81, 88 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 35 + "column": 46 }, - "end": { + "start": { "line": 4, - "column": 42 + "column": 43 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 89, 92 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 4, - "column": 43 + "column": 47 }, - "end": { + "start": { "line": 4, "column": 46 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 92, 93 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 46 + "column": 49 }, - "end": { + "start": { "line": 4, - "column": 47 + "column": 48 } - } - }, - { - "type": "Identifier", - "value": "U", + }, "range": [ 94, 95 ], + "value": "U" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 4, - "column": 48 + "column": 57 }, - "end": { + "start": { "line": 4, - "column": 49 + "column": 50 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 96, 103 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 4, - "column": 50 + "column": 59 }, - "end": { + "start": { "line": 4, - "column": 57 + "column": 58 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 104, 105 ], - "loc": { - "start": { - "line": 4, - "column": 58 - }, - "end": { - "line": 4, - "column": 59 - } - } + "value": "T" }, { "type": "Punctuator", @@ -3202,21 +3220,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 207, - 210 - ], "loc": { - "start": { - "line": 10, - "column": 2 - }, "end": { "line": 10, "column": 5 + }, + "start": { + "line": 10, + "column": 2 } - } + }, + "range": [ + 207, + 210 + ], + "value": "foo" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/document-fragment/vue3.3-generic-3/tree.json b/test/fixtures/document-fragment/vue3.3-generic-3/tree.json index 39979906..098b5927 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-3/tree.json +++ b/test/fixtures/document-fragment/vue3.3-generic-3/tree.json @@ -91,11 +91,6 @@ "type": "TSTypeParameter", "text": "T extends Foo", "children": [ - { - "type": "Identifier", - "text": "T", - "children": [] - }, { "type": "TSTypeReference", "text": "Foo", @@ -106,6 +101,11 @@ "children": [] } ] + }, + { + "type": "Identifier", + "text": "T", + "children": [] } ] }, @@ -113,11 +113,6 @@ "type": "TSTypeParameter", "text": "U extends T", "children": [ - { - "type": "Identifier", - "text": "U", - "children": [] - }, { "type": "TSTypeReference", "text": "T", @@ -128,6 +123,11 @@ "children": [] } ] + }, + { + "type": "Identifier", + "text": "U", + "children": [] } ] } diff --git a/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/document-fragment.json index 23514a87..fd104f1b 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/document-fragment.json +++ b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/document-fragment.json @@ -235,41 +235,26 @@ "params": [ { "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "range": [ - 36, - 37 - ], - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - } - }, + "const": false, "constraint": { "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 50, 53 ], "loc": { - "start": { - "line": 3, - "column": 12 - }, "end": { "line": 3, "column": 15 + }, + "start": { + "line": 3, + "column": 12 } } }, @@ -278,71 +263,75 @@ 53 ], "loc": { - "start": { - "line": 3, - "column": 12 - }, "end": { "line": 3, "column": 15 + }, + "start": { + "line": 3, + "column": 12 } } }, "in": false, + "name": { + "type": "Identifier", + "decorators": [], + "name": "T", + "optional": false, + "range": [ + 36, + 37 + ], + "loc": { + "end": { + "line": 2, + "column": 3 + }, + "start": { + "line": 2, + "column": 2 + } + } + }, "out": false, - "const": false, "range": [ 36, 53 ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 3, "column": 15 + }, + "start": { + "line": 2, + "column": 2 } } }, { "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "range": [ - 73, - 74 - ], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - } - }, + "const": false, "constraint": { "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 87, 88 ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 5 + }, + "start": { + "line": 6, + "column": 4 } } }, @@ -351,31 +340,50 @@ 88 ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 5 + }, + "start": { + "line": 6, + "column": 4 } } }, "in": false, + "name": { + "type": "Identifier", + "decorators": [], + "name": "U", + "optional": false, + "range": [ + 73, + 74 + ], + "loc": { + "end": { + "line": 5, + "column": 3 + }, + "start": { + "line": 5, + "column": 2 + } + } + }, "out": false, - "const": false, "range": [ 73, 88 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 6, "column": 5 + }, + "start": { + "line": 5, + "column": 2 } } } @@ -389,19 +397,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 50, 53 ], "loc": { - "start": { - "line": 3, - "column": 12 - }, "end": { "line": 3, "column": 15 + }, + "start": { + "line": 3, + "column": 12 } } }, @@ -455,19 +465,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 36, 37 ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } } }, @@ -476,19 +488,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "U", + "optional": false, "range": [ 73, 74 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } } }, @@ -589,19 +603,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 218, 221 ], "loc": { - "start": { - "line": 14, - "column": 2 - }, "end": { "line": 14, "column": 5 + }, + "start": { + "line": 14, + "column": 2 } } }, @@ -609,19 +625,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 218, 221 ], "loc": { - "start": { - "line": 14, - "column": 2 - }, "end": { "line": 14, "column": 5 + }, + "start": { + "line": 14, + "column": 2 } } }, @@ -815,129 +833,129 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 36, - 37 - ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } - } + }, + "range": [ + 36, + 37 + ], + "value": "T" }, { "type": "Keyword", - "value": "extends", + "loc": { + "end": { + "line": 3, + "column": 11 + }, + "start": { + "line": 3, + "column": 4 + } + }, "range": [ 42, 49 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 4 + "column": 15 }, - "end": { + "start": { "line": 3, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 50, 53 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 3, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 53, 54 ], - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", - "range": [ - 73, - 74 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 73, + 74 + ], + "value": "U" }, { "type": "Keyword", - "value": "extends", - "range": [ - 75, - 82 - ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 11 + }, + "start": { + "line": 5, + "column": 4 } - } + }, + "range": [ + 75, + 82 + ], + "value": "extends" }, { "type": "Identifier", - "value": "T", - "range": [ - 87, - 88 - ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 5 + }, + "start": { + "line": 6, + "column": 4 } - } + }, + "range": [ + 87, + 88 + ], + "value": "T" }, { "type": "Punctuator", @@ -1733,21 +1751,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 218, - 221 - ], "loc": { - "start": { - "line": 14, - "column": 2 - }, "end": { "line": 14, "column": 5 + }, + "start": { + "line": 14, + "column": 2 } - } + }, + "range": [ + 218, + 221 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -1825,21 +1843,21 @@ "comments": [ { "type": "Line", - "value": " Comments", - "range": [ - 59, - 70 - ], "loc": { - "start": { - "line": 4, - "column": 4 - }, "end": { "line": 4, "column": 15 + }, + "start": { + "line": 4, + "column": 4 } - } + }, + "range": [ + 59, + 70 + ], + "value": " Comments" } ], "errors": [] @@ -1992,129 +2010,129 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 36, - 37 - ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } - } + }, + "range": [ + 36, + 37 + ], + "value": "T" }, { "type": "Keyword", - "value": "extends", + "loc": { + "end": { + "line": 3, + "column": 11 + }, + "start": { + "line": 3, + "column": 4 + } + }, "range": [ 42, 49 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 4 + "column": 15 }, - "end": { + "start": { "line": 3, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 50, 53 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 3, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 53, 54 ], - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", - "range": [ - 73, - 74 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 73, + 74 + ], + "value": "U" }, { "type": "Keyword", - "value": "extends", - "range": [ - 75, - 82 - ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 11 + }, + "start": { + "line": 5, + "column": 4 } - } + }, + "range": [ + 75, + 82 + ], + "value": "extends" }, { "type": "Identifier", - "value": "T", - "range": [ - 87, - 88 - ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 5 + }, + "start": { + "line": 6, + "column": 4 } - } + }, + "range": [ + 87, + 88 + ], + "value": "T" }, { "type": "Punctuator", @@ -2910,21 +2928,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 218, - 221 - ], "loc": { - "start": { - "line": 14, - "column": 2 - }, "end": { "line": 14, "column": 5 + }, + "start": { + "line": 14, + "column": 2 } - } + }, + "range": [ + 218, + 221 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -3002,21 +3020,21 @@ "comments": [ { "type": "Line", - "value": " Comments", - "range": [ - 59, - 70 - ], "loc": { - "start": { - "line": 4, - "column": 4 - }, "end": { "line": 4, "column": 15 + }, + "start": { + "line": 4, + "column": 4 } - } + }, + "range": [ + 59, + 70 + ], + "value": " Comments" } ], "errors": [] diff --git a/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/tree.json b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/tree.json index 7e5efdcf..8ccbd3bd 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/tree.json +++ b/test/fixtures/document-fragment/vue3.3-generic-4-with-spaces/tree.json @@ -65,11 +65,6 @@ "type": "TSTypeParameter", "text": "T\n extends Foo", "children": [ - { - "type": "Identifier", - "text": "T", - "children": [] - }, { "type": "TSTypeReference", "text": "Foo", @@ -80,6 +75,11 @@ "children": [] } ] + }, + { + "type": "Identifier", + "text": "T", + "children": [] } ] }, @@ -87,11 +87,6 @@ "type": "TSTypeParameter", "text": "U extends\n T", "children": [ - { - "type": "Identifier", - "text": "U", - "children": [] - }, { "type": "TSTypeReference", "text": "T", @@ -102,6 +97,11 @@ "children": [] } ] + }, + { + "type": "Identifier", + "text": "U", + "children": [] } ] } diff --git a/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/document-fragment.json index 27212ef2..6ead8821 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/document-fragment.json +++ b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/document-fragment.json @@ -235,41 +235,26 @@ "params": [ { "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "range": [ - 36, - 37 - ], - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - } - }, + "const": false, "constraint": { "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 61, 64 ], "loc": { - "start": { - "line": 3, - "column": 12 - }, "end": { "line": 3, "column": 15 + }, + "start": { + "line": 3, + "column": 12 } } }, @@ -278,75 +263,59 @@ 64 ], "loc": { - "start": { - "line": 3, - "column": 12 - }, "end": { "line": 3, "column": 15 + }, + "start": { + "line": 3, + "column": 12 } } }, "in": false, + "name": { + "type": "Identifier", + "decorators": [], + "name": "T", + "optional": false, + "range": [ + 36, + 37 + ], + "loc": { + "end": { + "line": 2, + "column": 3 + }, + "start": { + "line": 2, + "column": 2 + } + } + }, "out": false, - "const": false, "range": [ 36, 64 ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 3, "column": 15 + }, + "start": { + "line": 2, + "column": 2 } } }, { "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "range": [ - 84, - 85 - ], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - } - }, + "const": false, "constraint": { "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Record", - "range": [ - 116, - 122 - ], - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 10 - } - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 122, @@ -360,13 +329,13 @@ 132 ], "loc": { - "start": { - "line": 7, - "column": 14 - }, "end": { "line": 7, "column": 20 + }, + "start": { + "line": 7, + "column": 14 } } }, @@ -374,19 +343,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 134, 135 ], "loc": { - "start": { - "line": 7, - "column": 22 - }, "end": { "line": 7, "column": 23 + }, + "start": { + "line": 7, + "column": 22 } } }, @@ -395,25 +366,45 @@ 135 ], "loc": { - "start": { - "line": 7, - "column": 22 - }, "end": { "line": 7, "column": 23 + }, + "start": { + "line": 7, + "column": 22 } } } ], "loc": { + "end": { + "line": 7, + "column": 24 + }, "start": { "line": 7, "column": 10 - }, + } + } + }, + "typeName": { + "type": "Identifier", + "decorators": [], + "name": "Record", + "optional": false, + "range": [ + 116, + 122 + ], + "loc": { "end": { "line": 7, - "column": 24 + "column": 10 + }, + "start": { + "line": 7, + "column": 4 } } }, @@ -422,31 +413,50 @@ 136 ], "loc": { - "start": { - "line": 7, - "column": 4 - }, "end": { "line": 7, "column": 24 + }, + "start": { + "line": 7, + "column": 4 } } }, "in": false, + "name": { + "type": "Identifier", + "decorators": [], + "name": "U", + "optional": false, + "range": [ + 84, + 85 + ], + "loc": { + "end": { + "line": 5, + "column": 3 + }, + "start": { + "line": 5, + "column": 2 + } + } + }, "out": false, - "const": false, "range": [ 84, 136 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 7, "column": 24 + }, + "start": { + "line": 5, + "column": 2 } } } @@ -460,19 +470,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 61, 64 ], "loc": { - "start": { - "line": 3, - "column": 12 - }, "end": { "line": 3, "column": 15 + }, + "start": { + "line": 3, + "column": 12 } } }, @@ -526,19 +538,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 36, 37 ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } } }, @@ -547,19 +561,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "U", + "optional": false, "range": [ 84, 85 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } } }, @@ -660,19 +676,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 266, 269 ], "loc": { - "start": { - "line": 15, - "column": 2 - }, "end": { "line": 15, "column": 5 + }, + "start": { + "line": 15, + "column": 2 } } }, @@ -680,19 +698,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 266, 269 ], "loc": { - "start": { - "line": 15, - "column": 2 - }, "end": { "line": 15, "column": 5 + }, + "start": { + "line": 15, + "column": 2 } } }, @@ -886,219 +906,219 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 36, - 37 - ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } - } + }, + "range": [ + 36, + 37 + ], + "value": "T" }, { "type": "Keyword", - "value": "extends", + "loc": { + "end": { + "line": 3, + "column": 11 + }, + "start": { + "line": 3, + "column": 4 + } + }, "range": [ 53, 60 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 4 + "column": 15 }, - "end": { + "start": { "line": 3, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 61, 64 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 3, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 64, 65 ], - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", - "range": [ - 84, - 85 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 84, + 85 + ], + "value": "U" }, { "type": "Keyword", - "value": "extends", - "range": [ - 104, - 111 - ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 11 + }, + "start": { + "line": 6, + "column": 4 } - } + }, + "range": [ + 104, + 111 + ], + "value": "extends" }, { "type": "Identifier", - "value": "Record", + "loc": { + "end": { + "line": 7, + "column": 10 + }, + "start": { + "line": 7, + "column": 4 + } + }, "range": [ 116, 122 ], + "value": "Record" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 4 + "column": 14 }, - "end": { + "start": { "line": 7, "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 122, 126 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 7, - "column": 10 + "column": 20 }, - "end": { + "start": { "line": 7, "column": 14 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 126, 132 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 14 + "column": 21 }, - "end": { + "start": { "line": 7, "column": 20 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 132, 133 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 7, - "column": 20 + "column": 23 }, - "end": { + "start": { "line": 7, - "column": 21 + "column": 22 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 134, 135 ], + "value": "T" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 22 + "column": 24 }, - "end": { + "start": { "line": 7, "column": 23 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 135, 136 ], - "loc": { - "start": { - "line": 7, - "column": 23 - }, - "end": { - "line": 7, - "column": 24 - } - } + "value": ">" }, { "type": "Punctuator", @@ -1894,21 +1914,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 266, - 269 - ], "loc": { - "start": { - "line": 15, - "column": 2 - }, "end": { "line": 15, "column": 5 + }, + "start": { + "line": 15, + "column": 2 } - } + }, + "range": [ + 266, + 269 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -1986,57 +2006,57 @@ "comments": [ { "type": "Line", - "value": " extends", - "range": [ - 38, - 48 - ], "loc": { - "start": { - "line": 2, - "column": 4 - }, "end": { "line": 2, "column": 14 + }, + "start": { + "line": 2, + "column": 4 } - } + }, + "range": [ + 38, + 48 + ], + "value": " extends" }, { "type": "Line", - "value": " Comments", - "range": [ - 70, - 81 - ], "loc": { - "start": { - "line": 4, - "column": 4 - }, "end": { "line": 4, "column": 15 + }, + "start": { + "line": 4, + "column": 4 } - } + }, + "range": [ + 70, + 81 + ], + "value": " Comments" }, { "type": "Block", - "value": " extends ", - "range": [ - 86, - 99 - ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 17 + }, + "start": { + "line": 5, + "column": 4 } - } + }, + "range": [ + 86, + 99 + ], + "value": " extends " } ], "errors": [] @@ -2189,219 +2209,219 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 36, - 37 - ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } - } + }, + "range": [ + 36, + 37 + ], + "value": "T" }, { "type": "Keyword", - "value": "extends", + "loc": { + "end": { + "line": 3, + "column": 11 + }, + "start": { + "line": 3, + "column": 4 + } + }, "range": [ 53, 60 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 4 + "column": 15 }, - "end": { + "start": { "line": 3, - "column": 11 + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 61, 64 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 12 + "column": 16 }, - "end": { + "start": { "line": 3, "column": 15 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 64, 65 ], - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", - "range": [ - 84, - 85 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 84, + 85 + ], + "value": "U" }, { "type": "Keyword", - "value": "extends", - "range": [ - 104, - 111 - ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 11 + }, + "start": { + "line": 6, + "column": 4 } - } + }, + "range": [ + 104, + 111 + ], + "value": "extends" }, { "type": "Identifier", - "value": "Record", + "loc": { + "end": { + "line": 7, + "column": 10 + }, + "start": { + "line": 7, + "column": 4 + } + }, "range": [ 116, 122 ], + "value": "Record" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 4 + "column": 14 }, - "end": { + "start": { "line": 7, "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 122, 126 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 7, - "column": 10 + "column": 20 }, - "end": { + "start": { "line": 7, "column": 14 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 126, 132 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 14 + "column": 21 }, - "end": { + "start": { "line": 7, "column": 20 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 132, 133 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 7, - "column": 20 + "column": 23 }, - "end": { + "start": { "line": 7, - "column": 21 + "column": 22 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ 134, 135 ], + "value": "T" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 22 + "column": 24 }, - "end": { + "start": { "line": 7, "column": 23 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 135, 136 ], - "loc": { - "start": { - "line": 7, - "column": 23 - }, - "end": { - "line": 7, - "column": 24 - } - } + "value": ">" }, { "type": "Punctuator", @@ -3197,21 +3217,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 266, - 269 - ], "loc": { - "start": { - "line": 15, - "column": 2 - }, "end": { "line": 15, "column": 5 + }, + "start": { + "line": 15, + "column": 2 } - } + }, + "range": [ + 266, + 269 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -3289,57 +3309,57 @@ "comments": [ { "type": "Line", - "value": " extends", - "range": [ - 38, - 48 - ], "loc": { - "start": { - "line": 2, - "column": 4 - }, "end": { "line": 2, "column": 14 + }, + "start": { + "line": 2, + "column": 4 } - } + }, + "range": [ + 38, + 48 + ], + "value": " extends" }, { "type": "Line", - "value": " Comments", - "range": [ - 70, - 81 - ], "loc": { - "start": { - "line": 4, - "column": 4 - }, "end": { "line": 4, "column": 15 + }, + "start": { + "line": 4, + "column": 4 } - } + }, + "range": [ + 70, + 81 + ], + "value": " Comments" }, { "type": "Block", - "value": " extends ", - "range": [ - 86, - 99 - ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 17 + }, + "start": { + "line": 5, + "column": 4 } - } + }, + "range": [ + 86, + 99 + ], + "value": " extends " } ], "errors": [] diff --git a/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/tree.json b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/tree.json index 4e69420d..eb531362 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/tree.json +++ b/test/fixtures/document-fragment/vue3.3-generic-5-with-spaces/tree.json @@ -65,11 +65,6 @@ "type": "TSTypeParameter", "text": "T // extends\n extends Foo", "children": [ - { - "type": "Identifier", - "text": "T", - "children": [] - }, { "type": "TSTypeReference", "text": "Foo", @@ -80,6 +75,11 @@ "children": [] } ] + }, + { + "type": "Identifier", + "text": "T", + "children": [] } ] }, @@ -87,20 +87,10 @@ "type": "TSTypeParameter", "text": "U /* extends */\n extends\n Record<string, T>", "children": [ - { - "type": "Identifier", - "text": "U", - "children": [] - }, { "type": "TSTypeReference", "text": "Record<string, T>", "children": [ - { - "type": "Identifier", - "text": "Record", - "children": [] - }, { "type": "TSTypeParameterInstantiation", "text": "<string, T>", @@ -122,8 +112,18 @@ ] } ] + }, + { + "type": "Identifier", + "text": "Record", + "children": [] } ] + }, + { + "type": "Identifier", + "text": "U", + "children": [] } ] } diff --git a/test/fixtures/document-fragment/vue3.3-generic-6-with-default/document-fragment.json b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/document-fragment.json index e1fb2002..36290861 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-6-with-default/document-fragment.json +++ b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/document-fragment.json @@ -235,41 +235,26 @@ "params": [ { "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "range": [ - 36, - 37 - ], - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - } - }, + "const": false, "constraint": { "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 70, 73 ], "loc": { - "start": { - "line": 3, - "column": 20 - }, "end": { "line": 3, "column": 23 + }, + "start": { + "line": 3, + "column": 20 } } }, @@ -278,13 +263,13 @@ 73 ], "loc": { - "start": { - "line": 3, - "column": 20 - }, "end": { "line": 3, "column": 23 + }, + "start": { + "line": 3, + "column": 20 } } }, @@ -295,75 +280,59 @@ 82 ], "loc": { - "start": { - "line": 3, - "column": 26 - }, "end": { "line": 3, "column": 32 + }, + "start": { + "line": 3, + "column": 26 } } }, "in": false, + "name": { + "type": "Identifier", + "decorators": [], + "name": "T", + "optional": false, + "range": [ + 36, + 37 + ], + "loc": { + "end": { + "line": 2, + "column": 3 + }, + "start": { + "line": 2, + "column": 2 + } + } + }, "out": false, - "const": false, "range": [ 36, 82 ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 3, "column": 32 + }, + "start": { + "line": 2, + "column": 2 } } }, { "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "range": [ - 102, - 103 - ], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - } - }, + "const": false, "constraint": { "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Record", - "range": [ - 134, - 140 - ], - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 10 - } - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 140, @@ -377,13 +346,13 @@ 171 ], "loc": { - "start": { - "line": 9, - "column": 6 - }, "end": { "line": 9, "column": 12 + }, + "start": { + "line": 9, + "column": 6 } } }, @@ -391,19 +360,21 @@ "type": "TSTypeReference", "typeName": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 184, 185 ], "loc": { - "start": { - "line": 10, - "column": 6 - }, "end": { "line": 10, "column": 7 + }, + "start": { + "line": 10, + "column": 6 } } }, @@ -412,25 +383,45 @@ 185 ], "loc": { - "start": { - "line": 10, - "column": 6 - }, "end": { "line": 10, "column": 7 + }, + "start": { + "line": 10, + "column": 6 } } } ], "loc": { + "end": { + "line": 11, + "column": 5 + }, "start": { "line": 7, "column": 10 - }, + } + } + }, + "typeName": { + "type": "Identifier", + "decorators": [], + "name": "Record", + "optional": false, + "range": [ + 134, + 140 + ], + "loc": { "end": { - "line": 11, - "column": 5 + "line": 7, + "column": 10 + }, + "start": { + "line": 7, + "column": 4 } } }, @@ -439,37 +430,19 @@ 191 ], "loc": { - "start": { - "line": 7, - "column": 4 - }, "end": { "line": 11, "column": 5 + }, + "start": { + "line": 7, + "column": 4 } } }, "default": { "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Record", - "range": [ - 199, - 205 - ], - "loc": { - "start": { - "line": 12, - "column": 7 - }, - "end": { - "line": 12, - "column": 13 - } - } - }, - "typeParameters": { + "typeArguments": { "type": "TSTypeParameterInstantiation", "range": [ 205, @@ -483,13 +456,13 @@ 212 ], "loc": { - "start": { - "line": 12, - "column": 14 - }, "end": { "line": 12, "column": 20 + }, + "start": { + "line": 12, + "column": 14 } } }, @@ -500,25 +473,45 @@ 220 ], "loc": { - "start": { - "line": 12, - "column": 22 - }, "end": { "line": 12, "column": 28 + }, + "start": { + "line": 12, + "column": 22 } } } ], "loc": { + "end": { + "line": 12, + "column": 32 + }, "start": { "line": 12, "column": 13 - }, + } + } + }, + "typeName": { + "type": "Identifier", + "decorators": [], + "name": "Record", + "optional": false, + "range": [ + 199, + 205 + ], + "loc": { "end": { "line": 12, - "column": 32 + "column": 13 + }, + "start": { + "line": 12, + "column": 7 } } }, @@ -527,31 +520,50 @@ 224 ], "loc": { - "start": { - "line": 12, - "column": 7 - }, "end": { "line": 12, "column": 32 + }, + "start": { + "line": 12, + "column": 7 } } }, "in": false, + "name": { + "type": "Identifier", + "decorators": [], + "name": "U", + "optional": false, + "range": [ + 102, + 103 + ], + "loc": { + "end": { + "line": 5, + "column": 3 + }, + "start": { + "line": 5, + "column": 2 + } + } + }, "out": false, - "const": false, "range": [ 102, 224 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 12, "column": 32 + }, + "start": { + "line": 5, + "column": 2 } } } @@ -565,19 +577,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "Foo", + "optional": false, "range": [ 70, 73 ], "loc": { - "start": { - "line": 3, - "column": 20 - }, "end": { "line": 3, "column": 23 + }, + "start": { + "line": 3, + "column": 20 } } }, @@ -631,19 +645,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "T", + "optional": false, "range": [ 36, 37 ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } } }, @@ -652,19 +668,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "U", + "optional": false, "range": [ 102, 103 ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } } }, @@ -765,19 +783,21 @@ }, "expression": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 354, 357 ], "loc": { - "start": { - "line": 20, - "column": 2 - }, "end": { "line": 20, "column": 5 + }, + "start": { + "line": 20, + "column": 2 } } }, @@ -785,19 +805,21 @@ { "id": { "type": "Identifier", + "decorators": [], "name": "foo", + "optional": false, "range": [ 354, 357 ], "loc": { - "start": { - "line": 20, - "column": 2 - }, "end": { "line": 20, "column": 5 + }, + "start": { + "line": 20, + "column": 2 } } }, @@ -991,381 +1013,381 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 36, - 37 - ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } - } + }, + "range": [ + 36, + 37 + ], + "value": "T" }, { "type": "Keyword", - "value": "extends", + "loc": { + "end": { + "line": 3, + "column": 11 + }, + "start": { + "line": 3, + "column": 4 + } + }, "range": [ 54, 61 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 4 + "column": 23 }, - "end": { + "start": { "line": 3, - "column": 11 + "column": 20 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 70, 73 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 20 + "column": 25 }, - "end": { + "start": { "line": 3, - "column": 23 + "column": 24 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 74, 75 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 24 + "column": 32 }, - "end": { + "start": { "line": 3, - "column": 25 + "column": 26 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 76, 82 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 26 + "column": 33 }, - "end": { + "start": { "line": 3, "column": 32 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 82, 83 ], - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 33 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", - "range": [ - 102, - 103 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 102, + 103 + ], + "value": "U" }, { "type": "Keyword", - "value": "extends", - "range": [ - 122, - 129 - ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 11 + }, + "start": { + "line": 6, + "column": 4 } - } + }, + "range": [ + 122, + 129 + ], + "value": "extends" }, { "type": "Identifier", - "value": "Record", - "range": [ - 134, - 140 - ], "loc": { - "start": { - "line": 7, - "column": 4 - }, "end": { "line": 7, "column": 10 + }, + "start": { + "line": 7, + "column": 4 } - } + }, + "range": [ + 134, + 140 + ], + "value": "Record" }, { "type": "Punctuator", - "value": "<", - "range": [ - 140, - 144 - ], "loc": { - "start": { - "line": 7, - "column": 10 - }, "end": { "line": 7, "column": 14 + }, + "start": { + "line": 7, + "column": 10 } - } + }, + "range": [ + 140, + 144 + ], + "value": "<" }, { "type": "Identifier", - "value": "string", + "loc": { + "end": { + "line": 9, + "column": 12 + }, + "start": { + "line": 9, + "column": 6 + } + }, "range": [ 165, 171 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 6 + "column": 13 }, - "end": { + "start": { "line": 9, "column": 12 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 171, 172 ], - "loc": { - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 9, - "column": 13 - } - } + "value": "," }, { "type": "Identifier", - "value": "T", - "range": [ - 184, - 185 - ], "loc": { - "start": { - "line": 10, - "column": 6 - }, "end": { "line": 10, "column": 7 + }, + "start": { + "line": 10, + "column": 6 } - } + }, + "range": [ + 184, + 185 + ], + "value": "T" }, { "type": "Punctuator", - "value": ">", - "range": [ - 190, - 191 - ], "loc": { - "start": { - "line": 11, - "column": 4 - }, "end": { "line": 11, "column": 5 + }, + "start": { + "line": 11, + "column": 4 } - } + }, + "range": [ + 190, + 191 + ], + "value": ">" }, { "type": "Punctuator", - "value": "=", + "loc": { + "end": { + "line": 12, + "column": 6 + }, + "start": { + "line": 12, + "column": 5 + } + }, "range": [ 197, 198 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 5 + "column": 13 }, - "end": { + "start": { "line": 12, - "column": 6 + "column": 7 } - } - }, - { - "type": "Identifier", - "value": "Record", + }, "range": [ 199, 205 ], + "value": "Record" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 7 + "column": 14 }, - "end": { + "start": { "line": 12, "column": 13 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 205, 206 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 13 + "column": 20 }, - "end": { + "start": { "line": 12, "column": 14 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 206, 212 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 14 + "column": 21 }, - "end": { + "start": { "line": 12, "column": 20 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 212, 213 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 20 + "column": 28 }, - "end": { + "start": { "line": 12, - "column": 21 + "column": 22 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 214, 220 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 22 + "column": 32 }, - "end": { + "start": { "line": 12, "column": 28 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 220, 224 ], - "loc": { - "start": { - "line": 12, - "column": 28 - }, - "end": { - "line": 12, - "column": 32 - } - } + "value": ">" }, { "type": "Punctuator", @@ -2161,21 +2183,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 354, - 357 - ], "loc": { - "start": { - "line": 20, - "column": 2 - }, "end": { "line": 20, "column": 5 + }, + "start": { + "line": 20, + "column": 2 } - } + }, + "range": [ + 354, + 357 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -2253,111 +2275,111 @@ "comments": [ { "type": "Line", - "value": " Comments", - "range": [ - 38, - 49 - ], "loc": { - "start": { - "line": 2, - "column": 4 - }, "end": { "line": 2, "column": 15 + }, + "start": { + "line": 2, + "column": 4 } - } + }, + "range": [ + 38, + 49 + ], + "value": " Comments" }, { "type": "Block", - "value": " = ", - "range": [ - 62, - 69 - ], "loc": { - "start": { - "line": 3, - "column": 12 - }, "end": { "line": 3, "column": 19 + }, + "start": { + "line": 3, + "column": 12 } - } + }, + "range": [ + 62, + 69 + ], + "value": " = " }, { "type": "Line", - "value": " Comments", - "range": [ - 88, - 99 - ], "loc": { - "start": { - "line": 4, - "column": 4 - }, "end": { "line": 4, "column": 15 + }, + "start": { + "line": 4, + "column": 4 } - } + }, + "range": [ + 88, + 99 + ], + "value": " Comments" }, { "type": "Block", - "value": " extends ", - "range": [ - 104, - 117 - ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 17 + }, + "start": { + "line": 5, + "column": 4 } - } + }, + "range": [ + 104, + 117 + ], + "value": " extends " }, { "type": "Block", - "value": " = ", - "range": [ - 151, - 158 - ], "loc": { - "start": { - "line": 8, - "column": 6 - }, "end": { "line": 8, "column": 13 + }, + "start": { + "line": 8, + "column": 6 } - } + }, + "range": [ + 151, + 158 + ], + "value": " = " }, { "type": "Line", - "value": " =", - "range": [ - 173, - 177 - ], "loc": { - "start": { - "line": 9, - "column": 14 - }, "end": { "line": 9, "column": 18 + }, + "start": { + "line": 9, + "column": 14 } - } + }, + "range": [ + 173, + 177 + ], + "value": " =" } ], "errors": [] @@ -2510,381 +2532,381 @@ }, { "type": "Identifier", - "value": "T", - "range": [ - 36, - 37 - ], "loc": { - "start": { - "line": 2, - "column": 2 - }, "end": { "line": 2, "column": 3 + }, + "start": { + "line": 2, + "column": 2 } - } + }, + "range": [ + 36, + 37 + ], + "value": "T" }, { "type": "Keyword", - "value": "extends", + "loc": { + "end": { + "line": 3, + "column": 11 + }, + "start": { + "line": 3, + "column": 4 + } + }, "range": [ 54, 61 ], + "value": "extends" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 4 + "column": 23 }, - "end": { + "start": { "line": 3, - "column": 11 + "column": 20 } - } - }, - { - "type": "Identifier", - "value": "Foo", + }, "range": [ 70, 73 ], + "value": "Foo" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 20 + "column": 25 }, - "end": { + "start": { "line": 3, - "column": 23 + "column": 24 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 74, 75 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 24 + "column": 32 }, - "end": { + "start": { "line": 3, - "column": 25 + "column": 26 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 76, 82 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 26 + "column": 33 }, - "end": { + "start": { "line": 3, "column": 32 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 82, 83 ], - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 33 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", - "range": [ - 102, - 103 - ], "loc": { - "start": { - "line": 5, - "column": 2 - }, "end": { "line": 5, "column": 3 + }, + "start": { + "line": 5, + "column": 2 } - } + }, + "range": [ + 102, + 103 + ], + "value": "U" }, { "type": "Keyword", - "value": "extends", - "range": [ - 122, - 129 - ], "loc": { - "start": { - "line": 6, - "column": 4 - }, "end": { "line": 6, "column": 11 + }, + "start": { + "line": 6, + "column": 4 } - } + }, + "range": [ + 122, + 129 + ], + "value": "extends" }, { "type": "Identifier", - "value": "Record", + "loc": { + "end": { + "line": 7, + "column": 10 + }, + "start": { + "line": 7, + "column": 4 + } + }, "range": [ 134, 140 ], + "value": "Record" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 7, - "column": 4 + "column": 14 }, - "end": { + "start": { "line": 7, "column": 10 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 140, 144 ], - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 14 - } - } + "value": "<" }, { "type": "Identifier", - "value": "string", - "range": [ - 165, - 171 - ], "loc": { - "start": { - "line": 9, - "column": 6 - }, "end": { "line": 9, "column": 12 + }, + "start": { + "line": 9, + "column": 6 } - } + }, + "range": [ + 165, + 171 + ], + "value": "string" }, { "type": "Punctuator", - "value": ",", - "range": [ - 171, - 172 - ], "loc": { - "start": { - "line": 9, - "column": 12 - }, "end": { "line": 9, "column": 13 + }, + "start": { + "line": 9, + "column": 12 } - } - }, - { - "type": "Identifier", - "value": "T", + }, "range": [ - 184, - 185 + 171, + 172 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { - "line": 10, - "column": 6 - }, "end": { "line": 10, "column": 7 + }, + "start": { + "line": 10, + "column": 6 } - } + }, + "range": [ + 184, + 185 + ], + "value": "T" }, { "type": "Punctuator", - "value": ">", - "range": [ - 190, - 191 - ], "loc": { - "start": { - "line": 11, - "column": 4 - }, "end": { "line": 11, "column": 5 + }, + "start": { + "line": 11, + "column": 4 } - } + }, + "range": [ + 190, + 191 + ], + "value": ">" }, { "type": "Punctuator", - "value": "=", + "loc": { + "end": { + "line": 12, + "column": 6 + }, + "start": { + "line": 12, + "column": 5 + } + }, "range": [ 197, 198 ], + "value": "=" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 5 + "column": 13 }, - "end": { + "start": { "line": 12, - "column": 6 + "column": 7 } - } - }, - { - "type": "Identifier", - "value": "Record", + }, "range": [ 199, 205 ], + "value": "Record" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 7 + "column": 14 }, - "end": { + "start": { "line": 12, "column": 13 } - } - }, - { - "type": "Punctuator", - "value": "<", + }, "range": [ 205, 206 ], + "value": "<" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 13 + "column": 20 }, - "end": { + "start": { "line": 12, "column": 14 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 206, 212 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 14 + "column": 21 }, - "end": { + "start": { "line": 12, "column": 20 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 212, 213 ], + "value": "," + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 12, - "column": 20 + "column": 28 }, - "end": { + "start": { "line": 12, - "column": 21 + "column": 22 } - } - }, - { - "type": "Identifier", - "value": "number", + }, "range": [ 214, 220 ], + "value": "number" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 12, - "column": 22 + "column": 32 }, - "end": { + "start": { "line": 12, "column": 28 } - } - }, - { - "type": "Punctuator", - "value": ">", + }, "range": [ 220, 224 ], - "loc": { - "start": { - "line": 12, - "column": 28 - }, - "end": { - "line": 12, - "column": 32 - } - } + "value": ">" }, { "type": "Punctuator", @@ -3680,21 +3702,21 @@ }, { "type": "Identifier", - "value": "foo", - "range": [ - 354, - 357 - ], "loc": { - "start": { - "line": 20, - "column": 2 - }, "end": { "line": 20, "column": 5 + }, + "start": { + "line": 20, + "column": 2 } - } + }, + "range": [ + 354, + 357 + ], + "value": "foo" }, { "type": "VExpressionEnd", @@ -3772,111 +3794,111 @@ "comments": [ { "type": "Line", - "value": " Comments", - "range": [ - 38, - 49 - ], "loc": { - "start": { - "line": 2, - "column": 4 - }, "end": { "line": 2, "column": 15 + }, + "start": { + "line": 2, + "column": 4 } - } + }, + "range": [ + 38, + 49 + ], + "value": " Comments" }, { "type": "Block", - "value": " = ", - "range": [ - 62, - 69 - ], "loc": { - "start": { - "line": 3, - "column": 12 - }, "end": { "line": 3, "column": 19 + }, + "start": { + "line": 3, + "column": 12 } - } + }, + "range": [ + 62, + 69 + ], + "value": " = " }, { "type": "Line", - "value": " Comments", - "range": [ - 88, - 99 - ], "loc": { - "start": { - "line": 4, - "column": 4 - }, "end": { "line": 4, "column": 15 + }, + "start": { + "line": 4, + "column": 4 } - } + }, + "range": [ + 88, + 99 + ], + "value": " Comments" }, { "type": "Block", - "value": " extends ", - "range": [ - 104, - 117 - ], "loc": { - "start": { - "line": 5, - "column": 4 - }, "end": { "line": 5, "column": 17 + }, + "start": { + "line": 5, + "column": 4 } - } + }, + "range": [ + 104, + 117 + ], + "value": " extends " }, { "type": "Block", - "value": " = ", - "range": [ - 151, - 158 - ], "loc": { - "start": { - "line": 8, - "column": 6 - }, "end": { "line": 8, "column": 13 + }, + "start": { + "line": 8, + "column": 6 } - } + }, + "range": [ + 151, + 158 + ], + "value": " = " }, { "type": "Line", - "value": " =", - "range": [ - 173, - 177 - ], "loc": { - "start": { - "line": 9, - "column": 14 - }, "end": { "line": 9, "column": 18 + }, + "start": { + "line": 9, + "column": 14 } - } + }, + "range": [ + 173, + 177 + ], + "value": " =" } ], "errors": [] diff --git a/test/fixtures/document-fragment/vue3.3-generic-6-with-default/tree.json b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/tree.json index 2147714f..ab3eb2d9 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-6-with-default/tree.json +++ b/test/fixtures/document-fragment/vue3.3-generic-6-with-default/tree.json @@ -65,11 +65,6 @@ "type": "TSTypeParameter", "text": "T // Comments\n extends /* = */ Foo = number", "children": [ - { - "type": "Identifier", - "text": "T", - "children": [] - }, { "type": "TSTypeReference", "text": "Foo", @@ -85,6 +80,11 @@ "type": "TSNumberKeyword", "text": "number", "children": [] + }, + { + "type": "Identifier", + "text": "T", + "children": [] } ] }, @@ -92,20 +92,10 @@ "type": "TSTypeParameter", "text": "U /* extends */\n extends\n Record<\n /* = */\n string, // =\n T\n >\n = Record", "children": [ - { - "type": "Identifier", - "text": "Record", - "children": [] - }, { "type": "TSTypeParameterInstantiation", "text": "<\n /* = */\n string, // =\n T\n >", @@ -127,6 +117,11 @@ ] } ] + }, + { + "type": "Identifier", + "text": "Record", + "children": [] } ] }, @@ -134,11 +129,6 @@ "type": "TSTypeReference", "text": "Record", + }, "range": [ 49, 51 ], + "value": "=>" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 15 + "column": 24 }, - "end": { + "start": { "line": 2, - "column": 17 + "column": 18 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 52, 58 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 18 + "column": 25 }, - "end": { + "start": { "line": 2, "column": 24 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 58, 59 ], - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", + "loc": { + "end": { + "line": 3, + "column": 3 + }, + "start": { + "line": 3, + "column": 2 + } + }, "range": [ 62, 63 ], + "value": "U" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 3, - "column": 2 + "column": 12 }, - "end": { + "start": { "line": 3, - "column": 3 + "column": 5 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 65, 72 ], + "value": "extends" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 5 + "column": 14 }, - "end": { + "start": { "line": 3, - "column": 12 + "column": 13 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 73, 74 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 13 + "column": 15 }, - "end": { + "start": { "line": 3, "column": 14 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 74, 75 ], + "value": ")" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 14 + "column": 18 }, - "end": { + "start": { "line": 3, - "column": 15 + "column": 16 } - } - }, - { - "type": "Punctuator", - "value": "=>", + }, "range": [ 76, 78 ], + "value": "=>" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 16 + "column": 25 }, - "end": { + "start": { "line": 3, - "column": 18 + "column": 19 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 79, 85 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 19 + "column": 27 }, - "end": { + "start": { "line": 3, - "column": 25 + "column": 26 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 86, 87 ], + "value": "=" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 26 + "column": 29 }, - "end": { + "start": { "line": 3, - "column": 27 + "column": 28 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 88, 89 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 28 + "column": 30 }, - "end": { + "start": { "line": 3, "column": 29 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 89, 90 ], + "value": ")" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 29 + "column": 33 }, - "end": { + "start": { "line": 3, - "column": 30 + "column": 31 } - } - }, - { - "type": "Punctuator", - "value": "=>", + }, "range": [ 91, 93 ], + "value": "=>" + }, + { + "type": "String", "loc": { - "start": { + "end": { "line": 3, - "column": 31 + "column": 39 }, - "end": { + "start": { "line": 3, - "column": 33 + "column": 34 } - } - }, - { - "type": "String", - "value": "'abc'", + }, "range": [ 94, 99 ], - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 39 - } - } + "value": "'abc'" }, { "type": "Punctuator", @@ -1842,93 +1862,93 @@ }, { "type": "Identifier", - "value": "p", + "loc": { + "end": { + "line": 9, + "column": 3 + }, + "start": { + "line": 9, + "column": 2 + } + }, "range": [ 165, 166 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 2 + "column": 4 }, - "end": { + "start": { "line": 9, "column": 3 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 166, 167 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 3 + "column": 5 }, - "end": { + "start": { "line": 9, "column": 4 } - } - }, - { - "type": "Identifier", - "value": "t", + }, "range": [ 167, 168 ], + "value": "t" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 4 + "column": 6 }, - "end": { + "start": { "line": 9, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 168, 169 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 5 + "column": 7 }, - "end": { + "start": { "line": 9, "column": 6 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 169, 170 ], - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 7 - } - } + "value": ")" }, { "type": "VExpressionEnd", @@ -1986,93 +2006,93 @@ }, { "type": "Identifier", - "value": "p", + "loc": { + "end": { + "line": 10, + "column": 3 + }, + "start": { + "line": 10, + "column": 2 + } + }, "range": [ 175, 176 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 2 + "column": 4 }, - "end": { + "start": { "line": 10, "column": 3 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 176, 177 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 3 + "column": 5 }, - "end": { + "start": { "line": 10, "column": 4 } - } - }, - { - "type": "Identifier", - "value": "u", + }, "range": [ 177, 178 ], + "value": "u" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 4 + "column": 6 }, - "end": { + "start": { "line": 10, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 178, 179 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 5 + "column": 7 }, - "end": { + "start": { "line": 10, "column": 6 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 179, 180 ], - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 7 - } - } + "value": ")" }, { "type": "VExpressionEnd", @@ -2298,327 +2318,327 @@ }, { "type": "Identifier", - "value": "T", + "loc": { + "end": { + "line": 2, + "column": 3 + }, + "start": { + "line": 2, + "column": 2 + } + }, "range": [ 36, 37 ], + "value": "T" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 2, - "column": 2 + "column": 11 }, - "end": { + "start": { "line": 2, - "column": 3 + "column": 4 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 38, 45 ], + "value": "extends" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 4 + "column": 13 }, - "end": { + "start": { "line": 2, - "column": 11 + "column": 12 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 46, 47 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 12 + "column": 14 }, - "end": { + "start": { "line": 2, "column": 13 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 47, 48 ], + "value": ")" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 13 + "column": 17 }, - "end": { + "start": { "line": 2, - "column": 14 + "column": 15 } - } - }, - { - "type": "Punctuator", - "value": "=>", + }, "range": [ 49, 51 ], + "value": "=>" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 2, - "column": 15 + "column": 24 }, - "end": { + "start": { "line": 2, - "column": 17 + "column": 18 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 52, 58 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 2, - "column": 18 + "column": 25 }, - "end": { + "start": { "line": 2, "column": 24 } - } - }, - { - "type": "Punctuator", - "value": ",", + }, "range": [ 58, 59 ], - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - } + "value": "," }, { "type": "Identifier", - "value": "U", + "loc": { + "end": { + "line": 3, + "column": 3 + }, + "start": { + "line": 3, + "column": 2 + } + }, "range": [ 62, 63 ], + "value": "U" + }, + { + "type": "Keyword", "loc": { - "start": { + "end": { "line": 3, - "column": 2 + "column": 12 }, - "end": { + "start": { "line": 3, - "column": 3 + "column": 5 } - } - }, - { - "type": "Keyword", - "value": "extends", + }, "range": [ 65, 72 ], + "value": "extends" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 5 + "column": 14 }, - "end": { + "start": { "line": 3, - "column": 12 + "column": 13 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 73, 74 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 13 + "column": 15 }, - "end": { + "start": { "line": 3, "column": 14 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 74, 75 ], + "value": ")" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 14 + "column": 18 }, - "end": { + "start": { "line": 3, - "column": 15 + "column": 16 } - } - }, - { - "type": "Punctuator", - "value": "=>", + }, "range": [ 76, 78 ], + "value": "=>" + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 3, - "column": 16 + "column": 25 }, - "end": { + "start": { "line": 3, - "column": 18 + "column": 19 } - } - }, - { - "type": "Identifier", - "value": "string", + }, "range": [ 79, 85 ], + "value": "string" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 19 + "column": 27 }, - "end": { + "start": { "line": 3, - "column": 25 + "column": 26 } - } - }, - { - "type": "Punctuator", - "value": "=", + }, "range": [ 86, 87 ], + "value": "=" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 26 + "column": 29 }, - "end": { + "start": { "line": 3, - "column": 27 + "column": 28 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 88, 89 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 28 + "column": 30 }, - "end": { + "start": { "line": 3, "column": 29 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 89, 90 ], + "value": ")" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 3, - "column": 29 + "column": 33 }, - "end": { + "start": { "line": 3, - "column": 30 + "column": 31 } - } - }, - { - "type": "Punctuator", - "value": "=>", + }, "range": [ 91, 93 ], + "value": "=>" + }, + { + "type": "String", "loc": { - "start": { + "end": { "line": 3, - "column": 31 + "column": 39 }, - "end": { + "start": { "line": 3, - "column": 33 + "column": 34 } - } - }, - { - "type": "String", - "value": "'abc'", + }, "range": [ 94, 99 ], - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 39 - } - } + "value": "'abc'" }, { "type": "Punctuator", @@ -3054,93 +3074,93 @@ }, { "type": "Identifier", - "value": "p", + "loc": { + "end": { + "line": 9, + "column": 3 + }, + "start": { + "line": 9, + "column": 2 + } + }, "range": [ 165, 166 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 2 + "column": 4 }, - "end": { + "start": { "line": 9, "column": 3 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 166, 167 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 9, - "column": 3 + "column": 5 }, - "end": { + "start": { "line": 9, "column": 4 } - } - }, - { - "type": "Identifier", - "value": "t", + }, "range": [ 167, 168 ], + "value": "t" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 4 + "column": 6 }, - "end": { + "start": { "line": 9, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 168, 169 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 9, - "column": 5 + "column": 7 }, - "end": { + "start": { "line": 9, "column": 6 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 169, 170 ], - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 7 - } - } + "value": ")" }, { "type": "VExpressionEnd", @@ -3198,93 +3218,93 @@ }, { "type": "Identifier", - "value": "p", + "loc": { + "end": { + "line": 10, + "column": 3 + }, + "start": { + "line": 10, + "column": 2 + } + }, "range": [ 175, 176 ], + "value": "p" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 2 + "column": 4 }, - "end": { + "start": { "line": 10, "column": 3 } - } - }, - { - "type": "Punctuator", - "value": ".", + }, "range": [ 176, 177 ], + "value": "." + }, + { + "type": "Identifier", "loc": { - "start": { + "end": { "line": 10, - "column": 3 + "column": 5 }, - "end": { + "start": { "line": 10, "column": 4 } - } - }, - { - "type": "Identifier", - "value": "u", + }, "range": [ 177, 178 ], + "value": "u" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 4 + "column": 6 }, - "end": { + "start": { "line": 10, "column": 5 } - } - }, - { - "type": "Punctuator", - "value": "(", + }, "range": [ 178, 179 ], + "value": "(" + }, + { + "type": "Punctuator", "loc": { - "start": { + "end": { "line": 10, - "column": 5 + "column": 7 }, - "end": { + "start": { "line": 10, "column": 6 } - } - }, - { - "type": "Punctuator", - "value": ")", + }, "range": [ 179, 180 ], - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 7 - } - } + "value": ")" }, { "type": "VExpressionEnd", diff --git a/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/tree.json b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/tree.json index 8a3067f7..64d30e2d 100644 --- a/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/tree.json +++ b/test/fixtures/document-fragment/vue3.3-generic-7-with-arrow/tree.json @@ -65,11 +65,6 @@ "type": "TSTypeParameter", "text": "T extends () => string", "children": [ - { - "type": "Identifier", - "text": "T", - "children": [] - }, { "type": "TSFunctionType", "text": "() => string", @@ -86,6 +81,11 @@ ] } ] + }, + { + "type": "Identifier", + "text": "T", + "children": [] } ] }, @@ -93,11 +93,6 @@ "type": "TSTypeParameter", "text": "U extends () => string = () => 'abc'", "children": [ - { - "type": "Identifier", - "text": "U", - "children": [] - }, { "type": "TSFunctionType", "text": "() => string", @@ -137,6 +132,11 @@ ] } ] + }, + { + "type": "Identifier", + "text": "U", + "children": [] } ] } diff --git a/test/fixtures/eslint b/test/fixtures/eslint deleted file mode 160000 index 8bb52766..00000000 --- a/test/fixtures/eslint +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8bb527660ffddc122204fb5bf59076687aaa78b8 diff --git a/test/index.js b/test/index.js index 8f8c9a19..3aecfb19 100644 --- a/test/index.js +++ b/test/index.js @@ -15,9 +15,7 @@ const fs = require("fs-extra") const semver = require("semver") const parse = require("../src").parse const parseForESLint = require("../src").parseForESLint -const eslint = require("./lib/eslint-compat")(require("./fixtures/eslint")) -const ESLint = eslint.ESLint -const Linter = eslint.Linter +const eslint = require("eslint") //------------------------------------------------------------------------------ // Helpers @@ -25,7 +23,7 @@ const Linter = eslint.Linter const ORIGINAL_FIXTURE_DIR = path.join(__dirname, "fixtures") const FIXTURE_DIR = path.join(__dirname, "temp") -const PARSER_PATH = path.resolve(__dirname, "../src/index.ts") +const parser = require("../src/index.ts") const BABEL_PARSER_OPTIONS = { parser: "@babel/eslint-parser", @@ -46,7 +44,13 @@ const BABEL_PARSER_OPTIONS = { // Tests //------------------------------------------------------------------------------ -describe("Basic tests", () => { +describe("Basic tests", async () => { + const ESLint = await eslint.loadESLint({ useFlatConfig: true }) + const Linter = class extends eslint.Linter { + constructor() { + super({ configType: "flat" }) + } + } beforeEach(() => { fs.emptyDirSync(FIXTURE_DIR) for (const fileName of fs.readdirSync(ORIGINAL_FIXTURE_DIR)) { @@ -67,11 +71,14 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + }, rules: { semi: "error" }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["hello.vue"]) const messages = report[0].messages @@ -90,11 +97,14 @@ describe("Basic tests", () => { cwd: FIXTURE_DIR, fix: true, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + }, rules: { semi: "error" }, }, - useEslintrc: false, + overrideConfigFile: true, }) await ESLint.outputFixes(await cli.lintFiles(["hello.vue"])) @@ -116,11 +126,14 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + }, rules: { semi: "error" }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["empty.vue"]) const messages = report[0].messages @@ -134,11 +147,14 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + }, rules: { semi: "error" }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["no-script.vue"]) const messages = report[0].messages @@ -152,11 +168,14 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + }, rules: { semi: "error" }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["empty-script.vue"]) const messages = report[0].messages @@ -170,11 +189,14 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + }, rules: { semi: "error" }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["no-end-script-tag.vue"]) const messages = report[0].messages @@ -188,11 +210,14 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.js"], + languageOptions: { + parser, + globals: {}, + }, rules: { semi: "error" }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["notvue.js"]) const messages = report[0].messages @@ -208,11 +233,14 @@ describe("Basic tests", () => { cwd: FIXTURE_DIR, fix: true, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.js"], + languageOptions: { + parser, + globals: {}, + }, rules: { semi: "error" }, }, - useEslintrc: false, + overrideConfigFile: true, }) await ESLint.outputFixes(await cli.lintFiles(["notvue.js"])) @@ -225,7 +253,7 @@ describe("Basic tests", () => { "utf8", ) - assert(actual === expected) + assert.strictEqual(actual, expected) }) }) @@ -234,11 +262,14 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + }, rules: { indent: "error" }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["crlf.vue"]) const messages = report[0].messages @@ -252,15 +283,18 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - ...BABEL_PARSER_OPTIONS, - sourceType: "module", + files: ["*.js"], + languageOptions: { + parser, + globals: {}, + parserOptions: { + ...BABEL_PARSER_OPTIONS, + sourceType: "module", + }, }, rules: { semi: ["error", "never"] }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["typed.js"]) const messages = report[0].messages @@ -273,14 +307,17 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - parser: "@typescript-eslint/parser", + files: ["*.js"], + languageOptions: { + parser, + globals: {}, + parserOptions: { + parser: "@typescript-eslint/parser", + }, }, rules: { semi: ["error", "never"] }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["typed.js"]) const messages = report[0].messages @@ -292,16 +329,19 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - parser: { - ts: "@typescript-eslint/parser", + files: ["*.ts", "*.tsx"], + languageOptions: { + parser, + globals: {}, + parserOptions: { + parser: { + ts: "@typescript-eslint/parser", + }, }, }, rules: { semi: ["error", "never"] }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["typed.ts", "typed.tsx"]) @@ -313,14 +353,17 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - parser: require("@typescript-eslint/parser"), + files: ["*.js"], + languageOptions: { + parser, + globals: {}, + parserOptions: { + parser: require("@typescript-eslint/parser"), + }, }, rules: { semi: ["error", "never"] }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["typed.js"]) const messages = report[0].messages @@ -332,16 +375,19 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - parser: { - ts: require("@typescript-eslint/parser"), + files: ["*.ts", "*.tsx"], + languageOptions: { + parser, + globals: {}, + parserOptions: { + parser: { + ts: require("@typescript-eslint/parser"), + }, }, }, rules: { semi: ["error", "never"] }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["typed.ts", "typed.tsx"]) @@ -356,15 +402,17 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - ...BABEL_PARSER_OPTIONS, - sourceType: "module", + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + parserOptions: { + ...BABEL_PARSER_OPTIONS, + }, }, rules: { semi: ["error", "never"] }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["typed.vue"]) const messages = report[0].messages @@ -377,14 +425,17 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - parser: "@typescript-eslint/parser", + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + parserOptions: { + parser: "@typescript-eslint/parser", + }, }, rules: { semi: ["error", "never"] }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["typed.vue"]) const messages = report[0].messages @@ -398,15 +449,17 @@ describe("Basic tests", () => { cwd: FIXTURE_DIR, fix: true, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - ...BABEL_PARSER_OPTIONS, - sourceType: "module", + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + parserOptions: { + ...BABEL_PARSER_OPTIONS, + }, }, rules: { semi: ["error", "always"] }, }, - useEslintrc: false, + overrideConfigFile: true, }) await ESLint.outputFixes(await cli.lintFiles(["typed.vue"])) @@ -428,14 +481,17 @@ describe("Basic tests", () => { cwd: FIXTURE_DIR, fix: true, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - parser: "@typescript-eslint/parser", + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + parserOptions: { + parser: "@typescript-eslint/parser", + }, }, rules: { semi: ["error", "always"] }, }, - useEslintrc: false, + overrideConfigFile: true, }) await ESLint.outputFixes(await cli.lintFiles(["typed.vue"])) @@ -448,7 +504,7 @@ describe("Basic tests", () => { "utf8", ) - assert(actual === expected) + assert.strictEqual(actual, expected) }) } }) @@ -459,14 +515,17 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - parser: "@typescript-eslint/parser", + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + parserOptions: { + parser: "@typescript-eslint/parser", + }, }, rules: { "no-unused-vars": ["error"] }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["ts-scope-manager.vue"]) const messages = report[0].messages @@ -485,10 +544,13 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["svg-attrs-colon.vue"]) const messages = report[0].messages @@ -500,10 +562,13 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { es6: true, node: true }, - parser: PARSER_PATH, + files: ["*.vue"], + languageOptions: { + parser, + globals: {}, + }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles(["svg-attrs-camel-case.vue"]) const messages = report[0].messages @@ -517,18 +582,21 @@ describe("Basic tests", () => { const cli = new ESLint({ cwd: FIXTURE_DIR, overrideConfig: { - env: { browser: true, node: true }, - parser: PARSER_PATH, - parserOptions: { - ...BABEL_PARSER_OPTIONS, - sourceType: "module", - ecmaVersion: 2017, + files: ["*.vue"], + languageOptions: { + parser, + parserOptions: { + ...BABEL_PARSER_OPTIONS, + sourceType: "module", + ecmaVersion: 2017, + }, + globals: {}, }, rules: { "no-use-before-define": "error", }, }, - useEslintrc: false, + overrideConfigFile: true, }) const report = await cli.lintFiles([ "location-issue-with-babel-eslint.vue", @@ -704,22 +772,25 @@ describe("Basic tests", () => { it("should work even if AST object was reused.", () => { const code = "" const config = { - parser: PARSER_PATH, + languageOptions: { + parser, + }, + plugins: buildPlugins({ + create(context) { + return context.sourceCode.parserServices.defineTemplateBodyVisitor( + { + "VElement[name='div']"(node) { + context.report({ node, message: "OK" }) + }, + }, + ) + }, + }), rules: { - "test-rule": "error", + "test/test-rule": "error", }, } const linter = new Linter() - - linter.defineParser(PARSER_PATH, require(PARSER_PATH)) - linter.defineRule("test-rule", (context) => - context.parserServices.defineTemplateBodyVisitor({ - "VElement[name='div']"(node) { - context.report({ node, message: "OK" }) - }, - }), - ) - const messages1 = linter.verify(code, config) const messages2 = linter.verify(linter.getSourceCode(), config) @@ -732,22 +803,28 @@ describe("Basic tests", () => { it("should work even if used sibling selector.", () => { const code = "" const config = { - parser: PARSER_PATH, + languageOptions: { + parser, + }, + plugins: buildPlugins({ + create(context) { + return context.sourceCode.parserServices.defineTemplateBodyVisitor( + { + "* ~ *"(node) { + context.report({ + node, + message: "OK", + }) + }, + }, + ) + }, + }), rules: { - "test-rule": "error", + "test/test-rule": "error", }, } const linter = new Linter() - - linter.defineParser(PARSER_PATH, require(PARSER_PATH)) - linter.defineRule("test-rule", (context) => - context.parserServices.defineTemplateBodyVisitor({ - "* ~ *"(node) { - context.report({ node, message: "OK" }) - }, - }), - ) - const messages1 = linter.verify(code, config) const messages2 = linter.verify(linter.getSourceCode(), config) @@ -763,12 +840,11 @@ describe("Basic tests", () => { const code = '' const config = { - parser: PARSER_PATH, + languageOptions: { + parser, + }, } const linter = new Linter() - - linter.defineParser(PARSER_PATH, require(PARSER_PATH)) - const messages = linter.verify(code, config) assert.strictEqual(messages.length, 1) @@ -780,15 +856,14 @@ describe("Basic tests", () => { it("should notify parsing error #2", () => { const code = "" const config = { - parser: PARSER_PATH, - parserOptions: { - ecmaVersion: 2015, + languageOptions: { + parser, + parserOptions: { + ecmaVersion: 2015, + }, }, } const linter = new Linter() - - linter.defineParser(PARSER_PATH, require(PARSER_PATH)) - const messages = linter.verify(code, config) assert.strictEqual(messages.length, 1) @@ -800,12 +875,11 @@ describe("Basic tests", () => { it("should notify parsing error #3", () => { const code = '' const config = { - parser: PARSER_PATH, + languageOptions: { + parser, + }, } const linter = new Linter() - - linter.defineParser(PARSER_PATH, require(PARSER_PATH)) - const messages = linter.verify(code, config) assert.strictEqual(messages.length, 1) @@ -818,15 +892,14 @@ describe("Basic tests", () => { const code = "" const config = { - parser: PARSER_PATH, + languageOptions: { + parser, + }, rules: { "no-undef": "error", }, } const linter = new Linter() - - linter.defineParser(PARSER_PATH, require(PARSER_PATH)) - const messages = linter.verify(code, config) assert.strictEqual(messages.length, 1) @@ -834,3 +907,13 @@ describe("Basic tests", () => { }) }) }) + +function buildPlugins(rule) { + return { + test: { + rules: { + "test-rule": rule, + }, + }, + } +} diff --git a/test/integrations.js b/test/integrations.js index 1f230e95..69a3004a 100644 --- a/test/integrations.js +++ b/test/integrations.js @@ -32,11 +32,13 @@ describe("Integration tests", () => { process.chdir(path.join(FIXTURE_DIR, target)) cp.execSync("npm i", { stdio: "inherit" }) ESLint = eslintCompat( - require(path.join( - FIXTURE_DIR, - target, - "node_modules/eslint", - )), + require( + path.join( + FIXTURE_DIR, + target, + "node_modules/eslint", + ), + ), ).ESLint } finally { process.chdir(originalCwd) @@ -94,8 +96,8 @@ describe("Integration tests", () => { a.filePath < b.filePath ? -1 : a.filePath < b.filePath - ? 1 - : 0, + ? 1 + : 0, ) } }) diff --git a/test/lib/eslint-compat.js b/test/lib/eslint-compat.js index 041807f3..9077ec55 100644 --- a/test/lib/eslint-compat.js +++ b/test/lib/eslint-compat.js @@ -80,7 +80,6 @@ function getESLintClassForV6(eslint) { * @param {Parameters} params * @returns {ReturnType} */ - // eslint-disable-next-line require-await -- ignore async lintText(...params) { const result = this.engine.executeOnText( params[0], @@ -93,7 +92,6 @@ function getESLintClassForV6(eslint) { * @param {Parameters} params * @returns {ReturnType} */ - // eslint-disable-next-line require-await -- ignore async lintFiles(...params) { const result = this.engine.executeOnFiles( Array.isArray(params[0]) ? params[0] : [params[0]], @@ -105,7 +103,6 @@ function getESLintClassForV6(eslint) { * @param {Parameters} params * @returns {ReturnType} */ - // eslint-disable-next-line require-await -- ignore static async outputFixes(...params) { return eslint.CLIEngine.outputFixes({ results: params[0], diff --git a/test/parser-options.js b/test/parser-options.js index 2c7f26eb..3c7e4e1b 100644 --- a/test/parser-options.js +++ b/test/parser-options.js @@ -6,33 +6,43 @@ const assert = require("assert") const { parseForESLint } = require("../src") -const eslint = require("./fixtures/eslint") +const eslint = require("eslint") const Linter = eslint.Linter describe("parserOptions", () => { describe("parser", () => { - const linter = new Linter() - linter.defineParser("vue-eslint-parser", { parseForESLint }) - linter.defineRule("vue/template-test", { - create(context) { - return { - Program(node) { - const element = node.templateBody - if (element != null) { - context.report({ node, message: "test" }) + const linter = new Linter({ configType: "flat" }) + const parser = { parseForESLint } + const plugin = { + rules: { + "template-test": { + create(context) { + return { + Program(node) { + const element = node.templateBody + if (element != null) { + context.report({ node, message: "test" }) + } + }, } }, - } + }, }, - }) + } it("false then skip parsing '` const config = { - parser: "vue-eslint-parser", - parserOptions: { - parser: false, + files: ["*.vue"], + plugins: { + vue: plugin, + }, + languageOptions: { + parser, + parserOptions: { + parser: false, + }, }, rules: { "vue/template-test": "error", @@ -44,12 +54,19 @@ describe("parserOptions", () => { assert.strictEqual(messages[0].ruleId, "vue/template-test") }) - it("Fail in ` const config = { - parser: "vue-eslint-parser", - parserOptions: {}, + files: ["*.vue"], + plugins: { + vue: plugin, + }, + languageOptions: { + parser, + sourceType: "script", + parserOptions: {}, + }, rules: {}, } const messages = linter.verify(code, config, "test.vue") From aca17d7c1991ce1c25d55d28ab42f6d9ac092219 Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Wed, 29 Jan 2025 13:42:53 +0900 Subject: [PATCH 58/76] Make to use `project: undefined` when parsing script-fragments in `