forked from typescript-eslint/typescript-eslint
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support parsing
satisfies
operators (typescript-eslint#5717)
Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com> Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
- Loading branch information
1 parent
23af77e
commit cc03e7e
Showing
106 changed files
with
5,467 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/fixture.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[1,2,3] satisfies [1, 2, 3]; |
149 changes: 149 additions & 0 deletions
149
...c/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/1-TSESTree-AST.shot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }, | ||
}, | ||
} | ||
`; |
166 changes: 166 additions & 0 deletions
166
...rc/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/2-TSESTree-Tokens.shot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }, | ||
}, | ||
}, | ||
] | ||
`; |
Oops, something went wrong.