diff --git a/.prettierignore b/.prettierignore index 637f32f77bf..88af276a1b2 100644 --- a/.prettierignore +++ b/.prettierignore @@ -12,6 +12,9 @@ packages/eslint-plugin/src/configs/*.json CONTRIBUTORS.md packages/ast-spec/src/*/*/fixtures/_error_/*/fixture.ts +# prettier doesn't yet support satisfies +packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/ + # Ignore CHANGELOG.md files to avoid issues with automated release job CHANGELOG.md diff --git a/README.md b/README.md index bddf59d198b..93bee2f66dc 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ The latest version under the `canary` tag **(latest commit to `main`)** is: ### Supported TypeScript Version -**The version range of TypeScript currently supported by this parser is `>=3.3.1 <4.9.0`.** +**The version range of TypeScript currently supported by this parser is `>=3.3.1 <5.0.0`.** These versions are what we test against. diff --git a/package.json b/package.json index f7c782af36e..e13d754021e 100644 --- a/package.json +++ b/package.json @@ -49,10 +49,11 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "devDependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/eslint-parser": "^7.18.2", - "@babel/parser": "^7.18.0", - "@babel/types": "^7.18.2", + "@babel/code-frame": "^7.18.6", + "@babel/core": "^7.20.2", + "@babel/eslint-parser": "^7.19.1", + "@babel/parser": "^7.20.3", + "@babel/types": "^7.20.2", "@nrwl/nx-cloud": "14.7.0", "@nrwl/workspace": "14.8.4", "@swc/core": "^1.3.1", @@ -109,7 +110,7 @@ "resolutions": { "typescript": "~4.9.3", "@types/node": "^18.11.9", - "//": "Pin jest to v29 across the repo", + "//": "Stub out unnecessary swc packages to improve install size and speed", "@jest/create-cache-key-function": "^29", "@jest/reporters": "^29", "@jest/test-result": "^29", @@ -121,7 +122,6 @@ "jest-snapshot": "^29", "jest-util": "^29", "pretty-format": "^29", - "//": "Stub out unnecessary swc packages to improve install size and speed", "@swc/core-android-arm-eabi": "npm:dummypkg-a@1.0.0", "@swc/core-android-arm64": "npm:dummypkg-a@1.0.0", "@swc/core-freebsd-x64": "npm:dummypkg-a@1.0.0", diff --git a/packages/ast-spec/src/ast-node-types.ts b/packages/ast-spec/src/ast-node-types.ts index ff90dd1ee18..dbed6723fed 100644 --- a/packages/ast-spec/src/ast-node-types.ts +++ b/packages/ast-spec/src/ast-node-types.ts @@ -145,6 +145,7 @@ export enum AST_NODE_TYPES { TSQualifiedName = 'TSQualifiedName', TSReadonlyKeyword = 'TSReadonlyKeyword', TSRestType = 'TSRestType', + TSSatisfiesExpression = 'TSSatisfiesExpression', TSStaticKeyword = 'TSStaticKeyword', TSStringKeyword = 'TSStringKeyword', TSSymbolKeyword = 'TSSymbolKeyword', diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/fixture.ts new file mode 100644 index 00000000000..917317da825 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/fixture.ts @@ -0,0 +1 @@ +[1,2,3] satisfies [1, 2, 3]; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..8c0e41971ea --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,149 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [3, 4], + loc: { + start: { column: 3, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [5, 6], + loc: { + start: { column: 5, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + ], + + range: [0, 7], + loc: { + start: { column: 0, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + + range: [18, 27], + loc: { + start: { column: 18, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..1bde181188c --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "[", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [2, 3], + loc: { + start: { column: 2, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [3, 4], + loc: { + start: { column: 3, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [4, 5], + loc: { + start: { column: 4, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [5, 6], + loc: { + start: { column: 5, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..d7f5aec514e --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/3-Babel-AST.shot @@ -0,0 +1,149 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [3, 4], + loc: { + start: { column: 3, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [5, 6], + loc: { + start: { column: 5, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + ], + + range: [0, 7], + loc: { + start: { column: 0, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + + range: [18, 27], + loc: { + start: { column: 18, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..02abe5d8cba --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "[", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [2, 3], + loc: { + start: { column: 2, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [3, 4], + loc: { + start: { column: 3, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [4, 5], + loc: { + start: { column: 4, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [5, 6], + loc: { + start: { column: 5, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..3cf7cab2487 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..263f9da8e6c --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/fixture.ts new file mode 100644 index 00000000000..8478834cb78 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/fixture.ts @@ -0,0 +1 @@ +() => 1 satisfies number diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..57067f8fbff --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [6, 24], + loc: { + start: { column: 6, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..09102ae267b --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [3, 5], + loc: { + start: { column: 3, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..1ef0e54b35d --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [6, 24], + loc: { + start: { column: 6, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..24cc5b2042e --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [3, 5], + loc: { + start: { column: 3, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..4697cea82c6 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..7fd90338cb4 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture.ts new file mode 100644 index 00000000000..15624b9aaf3 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture.ts @@ -0,0 +1 @@ +(() => 1) satisfies () => number diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..7fa95a22000 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [1, 8], + loc: { + start: { column: 1, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [26, 32], + loc: { + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [23, 32], + loc: { + start: { column: 23, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [20, 32], + loc: { + start: { column: 20, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..b590cfdea64 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [2, 3], + loc: { + start: { column: 2, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [4, 6], + loc: { + start: { column: 4, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [10, 19], + loc: { + start: { column: 10, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [23, 25], + loc: { + start: { column: 23, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [26, 32], + loc: { + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..71627f35b04 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [1, 8], + loc: { + start: { column: 1, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [26, 32], + loc: { + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [23, 32], + loc: { + start: { column: 23, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [20, 32], + loc: { + start: { column: 20, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..58d8821988a --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [2, 3], + loc: { + start: { column: 2, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [4, 6], + loc: { + start: { column: 4, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [10, 19], + loc: { + start: { column: 10, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [23, 25], + loc: { + start: { column: 23, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [26, 32], + loc: { + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..b45b591c63d --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,93 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: TSSatisfiesExpression { + type: 'TSSatisfiesExpression', + expression: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [1, 8], + loc: { + start: { column: 1, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [26, 32], + loc: { + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [23, 32], + loc: { + start: { column: 23, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [20, 32], + loc: { + start: { column: 20, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..f3d317fb4b7 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/fixture.ts new file mode 100644 index 00000000000..65dcd3629bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/fixture.ts @@ -0,0 +1 @@ +foo satisfies bar satisfies baz; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..508caf4b944 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "bar", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "baz", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..dd0ebe5a72f --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [18, 27], + loc: { + start: { column: 18, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..190d8d14fd0 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/3-Babel-AST.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "bar", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "baz", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..5afc144ecef --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [18, 27], + loc: { + start: { column: 18, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..0d7d689095e --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..b7cbaaf6bb8 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/fixture.ts new file mode 100644 index 00000000000..6ead32331fa --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/fixture.ts @@ -0,0 +1 @@ +foo ? 1 : 0 satisfies number; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..5674f78acdf --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ConditionalExpression { + type: "ConditionalExpression", + alternate: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [22, 28], + loc: { + start: { column: 22, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [10, 28], + loc: { + start: { column: 10, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + consequent: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + test: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..579fa0c0615 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [4, 5], + loc: { + start: { column: 4, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [12, 21], + loc: { + start: { column: 12, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [22, 28], + loc: { + start: { column: 22, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..9c3ff77da55 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ConditionalExpression { + type: "ConditionalExpression", + alternate: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [22, 28], + loc: { + start: { column: 22, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [10, 28], + loc: { + start: { column: 10, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + consequent: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + test: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..d9c69f96e5e --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [4, 5], + loc: { + start: { column: 4, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [12, 21], + loc: { + start: { column: 12, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [22, 28], + loc: { + start: { column: 22, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..a35b55978ba --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..220450772c1 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/fixture.ts new file mode 100644 index 00000000000..5c71ca2d0e6 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/fixture.ts @@ -0,0 +1 @@ +(foo ? 1 : 0) satisfies number; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..2194d921890 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ConditionalExpression { + type: "ConditionalExpression", + alternate: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + consequent: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + test: Identifier { + type: "Identifier", + name: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + + range: [1, 12], + loc: { + start: { column: 1, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [24, 30], + loc: { + start: { column: 24, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..09ed0254895 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [5, 6], + loc: { + start: { column: 5, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [14, 23], + loc: { + start: { column: 14, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [24, 30], + loc: { + start: { column: 24, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..39a9e9951ad --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ConditionalExpression { + type: "ConditionalExpression", + alternate: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + consequent: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + test: Identifier { + type: "Identifier", + name: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + + range: [1, 12], + loc: { + start: { column: 1, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [24, 30], + loc: { + start: { column: 24, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..7ca2b46ad24 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [5, 6], + loc: { + start: { column: 5, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [14, 23], + loc: { + start: { column: 14, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [24, 30], + loc: { + start: { column: 24, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..45e35dfc272 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..36442e7ebdc --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/fixture.ts new file mode 100644 index 00000000000..2ce6678d398 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/fixture.ts @@ -0,0 +1 @@ +foo satisfies boolean; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..7b7bb15a5af --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..3563bcb2809 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..8be9fb16653 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/3-Babel-AST.shot @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..2559a7666c6 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..c167cbcb46b --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..7dad93b1da3 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/fixture.ts new file mode 100644 index 00000000000..cdcca67f637 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/fixture.ts @@ -0,0 +1 @@ +foo satisfies { prop: 'value' }; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..6197262c7a0 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'value'", + value: "value", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [16, 29], + loc: { + start: { column: 16, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + + range: [14, 31], + loc: { + start: { column: 14, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..99673ea1ecf --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + String { + type: "String", + value: "'value'", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..a2861a34b1f --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'value'", + value: "value", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [16, 29], + loc: { + start: { column: 16, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + + range: [14, 31], + loc: { + start: { column: 14, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..34926c2bea7 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + String { + type: "String", + value: "'value'", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..8e025552275 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..bfb99b63e1c --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/fixture.ts new file mode 100644 index 00000000000..266a2ad0836 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/fixture.ts @@ -0,0 +1 @@ +foo satisfies [1, 2, 3]; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..57c80c5a805 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [14, 23], + loc: { + start: { column: 14, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..07ece3eadee --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..7201de5d38f --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [14, 23], + loc: { + start: { column: 14, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..8a62c8d0380 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..eb993d611eb --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..3f0aa9841e8 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/fixture.ts new file mode 100644 index 00000000000..09a4c612e30 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/fixture.ts @@ -0,0 +1 @@ +foo === 1 satisfies number; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..f80151c9032 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + operator: "===", + right: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [20, 26], + loc: { + start: { column: 20, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [8, 26], + loc: { + start: { column: 8, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..5391022e27f --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [4, 7], + loc: { + start: { column: 4, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [10, 19], + loc: { + start: { column: 10, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [20, 26], + loc: { + start: { column: 20, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..60189a70358 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + operator: "===", + right: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [20, 26], + loc: { + start: { column: 20, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [8, 26], + loc: { + start: { column: 8, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..cac159f58dc --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [4, 7], + loc: { + start: { column: 4, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [10, 19], + loc: { + start: { column: 10, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [20, 26], + loc: { + start: { column: 20, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..a21b35204c9 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..6a3c807848a --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/fixture.ts new file mode 100644 index 00000000000..a93f5746e7c --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/fixture.ts @@ -0,0 +1 @@ +(foo === 1) satisfies boolean; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..4401893b67e --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + operator: "===", + right: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [1, 10], + loc: { + start: { column: 1, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..7034fce1187 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [5, 8], + loc: { + start: { column: 5, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [12, 21], + loc: { + start: { column: 12, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..fb10fc5442e --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + operator: "===", + right: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [1, 10], + loc: { + start: { column: 1, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..4c73b5cc818 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [5, 8], + loc: { + start: { column: 5, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [12, 21], + loc: { + start: { column: 12, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..28594822212 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..b6881fd10cf --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts new file mode 100644 index 00000000000..ec7b71c8e2b --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts @@ -0,0 +1 @@ +({ prop: 'string' }) satisfies { prop: string }; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..1ed0e662a99 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [3, 17], + loc: { + start: { column: 3, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [33, 37], + loc: { + start: { column: 33, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + + range: [37, 45], + loc: { + start: { column: 37, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + + range: [33, 45], + loc: { + start: { column: 33, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + ], + + range: [31, 47], + loc: { + start: { column: 31, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + + range: [0, 47], + loc: { + start: { column: 0, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..99f068a424b --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [21, 30], + loc: { + start: { column: 21, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [33, 37], + loc: { + start: { column: 33, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [37, 38], + loc: { + start: { column: 37, line: 1 }, + end: { column: 38, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..c5868aaf0d1 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [3, 17], + loc: { + start: { column: 3, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [33, 37], + loc: { + start: { column: 33, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + + range: [37, 45], + loc: { + start: { column: 37, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + + range: [33, 45], + loc: { + start: { column: 33, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + ], + + range: [31, 47], + loc: { + start: { column: 31, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + + range: [0, 47], + loc: { + start: { column: 0, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..128fc9c6128 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [21, 30], + loc: { + start: { column: 21, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [33, 37], + loc: { + start: { column: 33, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [37, 38], + loc: { + start: { column: 37, line: 1 }, + end: { column: 38, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..bad308efe92 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..92a052f3254 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts new file mode 100644 index 00000000000..b7726f7f140 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts @@ -0,0 +1 @@ +({ prop: 'string' } satisfies { prop: string }); diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..9100755681a --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [3, 17], + loc: { + start: { column: 3, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [32, 36], + loc: { + start: { column: 32, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [36, 44], + loc: { + start: { column: 36, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [32, 44], + loc: { + start: { column: 32, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + ], + + range: [30, 46], + loc: { + start: { column: 30, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [1, 46], + loc: { + start: { column: 1, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..388f2790bb0 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [32, 36], + loc: { + start: { column: 32, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [36, 37], + loc: { + start: { column: 36, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [45, 46], + loc: { + start: { column: 45, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..16adf4fa64a --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [3, 17], + loc: { + start: { column: 3, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [32, 36], + loc: { + start: { column: 32, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [36, 44], + loc: { + start: { column: 36, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [32, 44], + loc: { + start: { column: 32, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + ], + + range: [30, 46], + loc: { + start: { column: 30, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [1, 46], + loc: { + start: { column: 1, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..bdca107f453 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [32, 36], + loc: { + start: { column: 32, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [36, 37], + loc: { + start: { column: 36, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [45, 46], + loc: { + start: { column: 45, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..982ccda73a2 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..c113b8be7e9 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/spec.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/spec.ts new file mode 100644 index 00000000000..1297ade3eba --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/spec.ts @@ -0,0 +1,10 @@ +import type { AST_NODE_TYPES } from '../../ast-node-types'; +import type { BaseNode } from '../../base/BaseNode'; +import type { Expression } from '../../unions/Expression'; +import type { TypeNode } from '../../unions/TypeNode'; + +export interface TSSatisfiesExpression extends BaseNode { + type: AST_NODE_TYPES.TSSatisfiesExpression; + expression: Expression; + typeAnnotation: TypeNode; +} diff --git a/packages/ast-spec/src/expression/spec.ts b/packages/ast-spec/src/expression/spec.ts index 9ed4a0cc756..f753672d472 100644 --- a/packages/ast-spec/src/expression/spec.ts +++ b/packages/ast-spec/src/expression/spec.ts @@ -23,6 +23,7 @@ export * from './TSAsExpression/spec'; export * from './TSEmptyBodyFunctionExpression/spec'; export * from './TSInstantiationExpression/spec'; export * from './TSNonNullExpression/spec'; +export * from './TSSatisfiesExpression/spec'; export * from './TSTypeAssertion/spec'; export * from './TaggedTemplateExpression/spec'; export * from './TemplateLiteral/spec'; diff --git a/packages/ast-spec/src/unions/Expression.ts b/packages/ast-spec/src/unions/Expression.ts index 36220bc0391..1c0ee899ec3 100644 --- a/packages/ast-spec/src/unions/Expression.ts +++ b/packages/ast-spec/src/unions/Expression.ts @@ -25,6 +25,7 @@ import type { ThisExpression } from '../expression/ThisExpression/spec'; import type { TSAsExpression } from '../expression/TSAsExpression/spec'; import type { TSInstantiationExpression } from '../expression/TSInstantiationExpression/spec'; import type { TSNonNullExpression } from '../expression/TSNonNullExpression/spec'; +import type { TSSatisfiesExpression } from '../expression/TSSatisfiesExpression/spec'; import type { TSTypeAssertion } from '../expression/TSTypeAssertion/spec'; import type { UnaryExpression } from '../expression/UnaryExpression/spec'; import type { UpdateExpression } from '../expression/UpdateExpression/spec'; @@ -72,6 +73,7 @@ export type Expression = | TSAsExpression | TSInstantiationExpression | TSNonNullExpression + | TSSatisfiesExpression | TSTypeAssertion | UnaryExpression | UpdateExpression diff --git a/packages/ast-spec/src/unions/Node.ts b/packages/ast-spec/src/unions/Node.ts index 6505270427b..3656a3d677a 100644 --- a/packages/ast-spec/src/unions/Node.ts +++ b/packages/ast-spec/src/unions/Node.ts @@ -53,6 +53,7 @@ import type { TSAsExpression } from '../expression/TSAsExpression/spec'; import type { TSEmptyBodyFunctionExpression } from '../expression/TSEmptyBodyFunctionExpression/spec'; import type { TSInstantiationExpression } from '../expression/TSInstantiationExpression/spec'; import type { TSNonNullExpression } from '../expression/TSNonNullExpression/spec'; +import type { TSSatisfiesExpression } from '../expression/TSSatisfiesExpression/spec'; import type { TSTypeAssertion } from '../expression/TSTypeAssertion/spec'; import type { UnaryExpression } from '../expression/UnaryExpression/spec'; import type { UpdateExpression } from '../expression/UpdateExpression/spec'; @@ -305,6 +306,7 @@ export type Node = | TSQualifiedName | TSReadonlyKeyword | TSRestType + | TSSatisfiesExpression | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot index 9d3e5d88ccc..beff8134d6e 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot @@ -24,5 +24,6 @@ Set { "declaration/TSInterfaceDeclaration/fixtures/type-param-one/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/type-param-many/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/type-param-one/fixture.ts", + "expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture.ts", } `; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 30c33050d42..ca53cc45a44 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2954,6 +2954,14 @@ export class Converter { }); } + case SyntaxKind.SatisfiesExpression: { + return this.createNode(node, { + type: AST_NODE_TYPES.TSSatisfiesExpression, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertChild(node.type), + }); + } + default: return this.deeplyCopy(node); } diff --git a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts index 3b80ab0a958..12ff9392cb0 100644 --- a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts +++ b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts @@ -185,6 +185,7 @@ export interface EstreeToTsNodeTypes { [AST_NODE_TYPES.TSInterfaceHeritage]: ts.ExpressionWithTypeArguments; [AST_NODE_TYPES.TSIntersectionType]: ts.IntersectionTypeNode; [AST_NODE_TYPES.TSInstantiationExpression]: ts.ExpressionWithTypeArguments; + [AST_NODE_TYPES.TSSatisfiesExpression]: ts.SatisfiesExpression; [AST_NODE_TYPES.TSLiteralType]: ts.LiteralTypeNode; [AST_NODE_TYPES.TSMappedType]: ts.MappedTypeNode; [AST_NODE_TYPES.TSMethodSignature]: diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index 28c30ea8bc3..873f98e5a15 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -180,6 +180,7 @@ export type TSNode = | ts.UnparsedSource | ts.JsonMinusNumericLiteral | ts.TemplateLiteralTypeNode + | ts.SatisfiesExpression // JSDoc: Unsupported | ts.JSDoc diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 6abab590b77..9c4d8a44bcc 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -477,6 +477,11 @@ tester.addFixturePatternConfig('typescript/expressions', { * @see https://github.com/babel/babel/issues/14613 */ 'instantiation-expression', + /** + * TS 4.9 `satisfies` operator has not been implemented in Babel yet. + * @see https://github.com/babel/babel/pull/14211 + */ + 'satisfies-expression', ], }); diff --git a/packages/visitor-keys/src/visitor-keys.ts b/packages/visitor-keys/src/visitor-keys.ts index a1898e92246..cb3e614df53 100644 --- a/packages/visitor-keys/src/visitor-keys.ts +++ b/packages/visitor-keys/src/visitor-keys.ts @@ -127,6 +127,7 @@ const additionalKeys: AdditionalKeys = { TSQualifiedName: ['left', 'right'], TSReadonlyKeyword: [], TSRestType: ['typeAnnotation'], + TSSatisfiesExpression: ['typeAnnotation', 'expression'], TSStaticKeyword: [], TSStringKeyword: [], TSSymbolKeyword: [], diff --git a/yarn.lock b/yarn.lock index 07d19a8fc38..fd624953978 100644 --- a/yarn.lock +++ b/yarn.lock @@ -153,7 +153,7 @@ dependencies: axe-core "^4.4.3" -"@babel/code-frame@*", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.8.3": +"@babel/code-frame@*", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.8.3": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== @@ -165,6 +165,11 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.3.tgz#707b939793f867f5a73b2666e6d9a3396eb03151" integrity sha512-prBHMK4JYYK+wDjJF1q99KK4JLL+egWS4nmNqdlMUgCExMZ+iZW0hGhyC3VEbsPjvaN0TBhW//VIFwBrk8sEiw== +"@babel/compat-data@^7.20.0": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.1.tgz#f2e6ef7790d8c8dbf03d379502dcc246dcce0b30" + integrity sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ== + "@babel/core@*", "@babel/core@^7.11.1", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.15.5", "@babel/core@^7.18.6": version "7.19.3" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.3.tgz#2519f62a51458f43b682d61583c3810e7dcee64c" @@ -208,7 +213,28 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/eslint-parser@*", "@babel/eslint-parser@^7.18.2": +"@babel/core@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.2.tgz#8dc9b1620a673f92d3624bd926dc49a52cf25b92" + integrity sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.2" + "@babel/helper-compilation-targets" "^7.20.0" + "@babel/helper-module-transforms" "^7.20.2" + "@babel/helpers" "^7.20.1" + "@babel/parser" "^7.20.2" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.2" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.1" + semver "^6.3.0" + +"@babel/eslint-parser@*", "@babel/eslint-parser@^7.19.1": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz#4f68f6b0825489e00a24b41b6a1ae35414ecd2f4" integrity sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ== @@ -226,6 +252,15 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" +"@babel/generator@^7.20.1", "@babel/generator@^7.20.2": + version "7.20.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.4.tgz#4d9f8f0c30be75fd90a0562099a26e5839602ab8" + integrity sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA== + dependencies: + "@babel/types" "^7.20.2" + "@jridgewell/gen-mapping" "^0.3.2" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" @@ -251,6 +286,16 @@ browserslist "^4.21.3" semver "^6.3.0" +"@babel/helper-compilation-targets@^7.20.0": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz#6bf5374d424e1b3922822f1d9bdaa43b1a139d0a" + integrity sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ== + dependencies: + "@babel/compat-data" "^7.20.0" + "@babel/helper-validator-option" "^7.18.6" + browserslist "^4.21.3" + semver "^6.3.0" + "@babel/helper-create-class-features-plugin@^7.18.6": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.9.tgz#d802ee16a64a9e824fcbf0a2ffc92f19d58550ce" @@ -339,6 +384,20 @@ "@babel/traverse" "^7.19.0" "@babel/types" "^7.19.0" +"@babel/helper-module-transforms@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz#ac53da669501edd37e658602a21ba14c08748712" + integrity sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-validator-identifier" "^7.19.1" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.2" + "@babel/helper-optimise-call-expression@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" @@ -384,6 +443,13 @@ dependencies: "@babel/types" "^7.18.6" +"@babel/helper-simple-access@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" + integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== + dependencies: + "@babel/types" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers@^7.18.9": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.18.9.tgz#778d87b3a758d90b471e7b9918f34a9a02eb5818" @@ -403,6 +469,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz#181f22d28ebe1b3857fa575f5c290b1aaf659b56" integrity sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw== +"@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== + "@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" @@ -432,6 +503,15 @@ "@babel/traverse" "^7.19.0" "@babel/types" "^7.19.0" +"@babel/helpers@^7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.1.tgz#2ab7a0fcb0a03b5bf76629196ed63c2d7311f4c9" + integrity sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg== + dependencies: + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.0" + "@babel/highlight@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" @@ -441,11 +521,16 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@*", "@babel/parser@^7.1.0", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.18.0", "@babel/parser@^7.18.10", "@babel/parser@^7.18.8", "@babel/parser@^7.19.3": +"@babel/parser@*", "@babel/parser@^7.1.0", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.8", "@babel/parser@^7.19.3": version "7.19.3" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.3.tgz#8dd36d17c53ff347f9e55c328710321b49479a9a" integrity sha512-pJ9xOlNWHiy9+FuFP09DEAFbAn4JskgRsVcc169w2xRBC3FRGuQEwjeIMMND9L2zc0iEhO/tGv4Zq+km+hxNpQ== +"@babel/parser@^7.20.1", "@babel/parser@^7.20.2", "@babel/parser@^7.20.3": + version "7.20.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.3.tgz#5358cf62e380cf69efcb87a7bb922ff88bfac6e2" + integrity sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" @@ -1207,7 +1292,23 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.7", "@babel/types@^7.15.6", "@babel/types@^7.18.10", "@babel/types@^7.18.2", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.19.3", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/traverse@^7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.1.tgz#9b15ccbf882f6d107eeeecf263fbcdd208777ec8" + integrity sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.1" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.20.1" + "@babel/types" "^7.20.0" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.12.7", "@babel/types@^7.15.6", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.19.3", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.19.3" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.3.tgz#fc420e6bbe54880bce6779ffaf315f5e43ec9624" integrity sha512-hGCaQzIY22DJlDh9CH7NOxgKkFjBk0Cw9xDO1Xmh2151ti7wiGfQ3LauXzL4HP1fmFlTX6XjpRETTpUcv7wQLw== @@ -1216,6 +1317,15 @@ "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" +"@babel/types@^7.20.0", "@babel/types@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.2.tgz#67ac09266606190f496322dbaff360fdaa5e7842" + integrity sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog== + dependencies: + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" + to-fast-properties "^2.0.0" + "@bcherny/json-schema-ref-parser@9.0.9": version "9.0.9" resolved "https://registry.yarnpkg.com/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#09899d405bc708c0acac0066ae8db5b94d465ca4"