forked from typescript-eslint/typescript-eslint
/
Expression.ts
78 lines (75 loc) · 3.64 KB
/
Expression.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import type { ArrayExpression } from '../expression/ArrayExpression/spec';
import type { ArrowFunctionExpression } from '../expression/ArrowFunctionExpression/spec';
import type { AssignmentExpression } from '../expression/AssignmentExpression/spec';
import type { AwaitExpression } from '../expression/AwaitExpression/spec';
import type { BinaryExpression } from '../expression/BinaryExpression/spec';
import type { CallExpression } from '../expression/CallExpression/spec';
import type { ChainExpression } from '../expression/ChainExpression/spec';
import type { ClassExpression } from '../expression/ClassExpression/spec';
import type { ConditionalExpression } from '../expression/ConditionalExpression/spec';
import type { FunctionExpression } from '../expression/FunctionExpression/spec';
import type { Identifier } from '../expression/Identifier/spec';
import type { ImportExpression } from '../expression/ImportExpression/spec';
import type { JSXElement } from '../expression/JSXElement/spec';
import type { JSXFragment } from '../expression/JSXFragment/spec';
import type { LogicalExpression } from '../expression/LogicalExpression/spec';
import type { MemberExpression } from '../expression/MemberExpression/spec';
import type { MetaProperty } from '../expression/MetaProperty/spec';
import type { NewExpression } from '../expression/NewExpression/spec';
import type { ObjectExpression } from '../expression/ObjectExpression/spec';
import type { SequenceExpression } from '../expression/SequenceExpression/spec';
import type { Super } from '../expression/Super/spec';
import type { TaggedTemplateExpression } from '../expression/TaggedTemplateExpression/spec';
import type { TemplateLiteral } from '../expression/TemplateLiteral/spec';
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 { TSTypeAssertion } from '../expression/TSTypeAssertion/spec';
import type { UnaryExpression } from '../expression/UnaryExpression/spec';
import type { UpdateExpression } from '../expression/UpdateExpression/spec';
import type { YieldExpression } from '../expression/YieldExpression/spec';
import type { ArrayPattern } from '../parameter/ArrayPattern/spec';
import type { ObjectPattern } from '../parameter/ObjectPattern/spec';
import type { LiteralExpression } from './LiteralExpression';
/*
This isn't technically correct, as it includes ArrayPattern and ObjectPattern - which are only valid
in a LeftHandSideExpression, and not in a general expression location.
However most of the time that this type is used, the intention will be to assign a LeftHandSideExpression to this type.
So excluding the Pattern types just makes it a pain, as people have to write Expression | LeftHandSideExpression everywhere.
*/
export type Expression =
| ArrayExpression
| ArrayPattern
| ArrowFunctionExpression
| AssignmentExpression
| AwaitExpression
| BinaryExpression
| CallExpression
| ChainExpression
| ClassExpression
| ConditionalExpression
| FunctionExpression
| Identifier
| ImportExpression
| JSXElement
| JSXFragment
| LiteralExpression
| LogicalExpression
| MemberExpression
| MetaProperty
| NewExpression
| ObjectExpression
| ObjectPattern
| SequenceExpression
| Super
| TaggedTemplateExpression
| TemplateLiteral
| ThisExpression
| TSAsExpression
| TSInstantiationExpression
| TSNonNullExpression
| TSTypeAssertion
| UnaryExpression
| UpdateExpression
| YieldExpression;