Skip to content

Commit 8301a98

Browse files
committed
Update lazy-estree.ts
1 parent e31cbed commit 8301a98

1 file changed

Lines changed: 169 additions & 60 deletions

File tree

packages/compat-eslint/lib/lazy-estree.ts

Lines changed: 169 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -126,67 +126,168 @@ const EMPTY_ARRAY: never[] = Object.freeze([]) as never[];
126126
// are dynamic via TypeKeywordNode, so they go in here too.
127127
type KnownEstreeType =
128128
// Core ESTree
129-
| 'AccessorProperty' | 'ArrayExpression' | 'ArrayPattern'
129+
| 'AccessorProperty'
130+
| 'ArrayExpression'
131+
| 'ArrayPattern'
130132
| 'ArrowFunctionExpression'
131-
| 'AssignmentExpression' | 'AssignmentPattern' | 'AwaitExpression'
132-
| 'BinaryExpression' | 'BlockStatement' | 'BreakStatement'
133-
| 'CallExpression' | 'CatchClause' | 'ChainExpression'
134-
| 'ClassBody' | 'ClassDeclaration' | 'ClassExpression'
135-
| 'ConditionalExpression' | 'ContinueStatement' | 'DebuggerStatement'
136-
| 'Decorator' | 'DoWhileStatement' | 'EmptyStatement'
137-
| 'ExportAllDeclaration' | 'ExportDefaultDeclaration'
138-
| 'ExportNamedDeclaration' | 'ExportSpecifier' | 'ExpressionStatement'
139-
| 'ForInStatement' | 'ForOfStatement' | 'ForStatement'
140-
| 'FunctionDeclaration' | 'FunctionExpression' | 'Identifier'
141-
| 'IfStatement' | 'ImportAttribute' | 'ImportDeclaration'
142-
| 'ImportDefaultSpecifier' | 'ImportExpression' | 'ImportNamespaceSpecifier'
143-
| 'ImportSpecifier' | 'LabeledStatement' | 'Literal'
144-
| 'LogicalExpression' | 'MemberExpression' | 'MetaProperty'
145-
| 'MethodDefinition' | 'NewExpression' | 'ObjectExpression'
146-
| 'ObjectPattern' | 'PrivateIdentifier' | 'Program' | 'Property'
147-
| 'PropertyDefinition' | 'RestElement' | 'ReturnStatement'
148-
| 'SequenceExpression' | 'SpreadElement' | 'StaticBlock'
149-
| 'Super' | 'SwitchCase' | 'SwitchStatement'
150-
| 'TaggedTemplateExpression' | 'TemplateElement' | 'TemplateLiteral'
151-
| 'ThisExpression' | 'ThrowStatement' | 'TryStatement'
152-
| 'UnaryExpression' | 'UpdateExpression' | 'VariableDeclaration'
153-
| 'VariableDeclarator' | 'WhileStatement' | 'WithStatement'
133+
| 'AssignmentExpression'
134+
| 'AssignmentPattern'
135+
| 'AwaitExpression'
136+
| 'BinaryExpression'
137+
| 'BlockStatement'
138+
| 'BreakStatement'
139+
| 'CallExpression'
140+
| 'CatchClause'
141+
| 'ChainExpression'
142+
| 'ClassBody'
143+
| 'ClassDeclaration'
144+
| 'ClassExpression'
145+
| 'ConditionalExpression'
146+
| 'ContinueStatement'
147+
| 'DebuggerStatement'
148+
| 'Decorator'
149+
| 'DoWhileStatement'
150+
| 'EmptyStatement'
151+
| 'ExportAllDeclaration'
152+
| 'ExportDefaultDeclaration'
153+
| 'ExportNamedDeclaration'
154+
| 'ExportSpecifier'
155+
| 'ExpressionStatement'
156+
| 'ForInStatement'
157+
| 'ForOfStatement'
158+
| 'ForStatement'
159+
| 'FunctionDeclaration'
160+
| 'FunctionExpression'
161+
| 'Identifier'
162+
| 'IfStatement'
163+
| 'ImportAttribute'
164+
| 'ImportDeclaration'
165+
| 'ImportDefaultSpecifier'
166+
| 'ImportExpression'
167+
| 'ImportNamespaceSpecifier'
168+
| 'ImportSpecifier'
169+
| 'LabeledStatement'
170+
| 'Literal'
171+
| 'LogicalExpression'
172+
| 'MemberExpression'
173+
| 'MetaProperty'
174+
| 'MethodDefinition'
175+
| 'NewExpression'
176+
| 'ObjectExpression'
177+
| 'ObjectPattern'
178+
| 'PrivateIdentifier'
179+
| 'Program'
180+
| 'Property'
181+
| 'PropertyDefinition'
182+
| 'RestElement'
183+
| 'ReturnStatement'
184+
| 'SequenceExpression'
185+
| 'SpreadElement'
186+
| 'StaticBlock'
187+
| 'Super'
188+
| 'SwitchCase'
189+
| 'SwitchStatement'
190+
| 'TaggedTemplateExpression'
191+
| 'TemplateElement'
192+
| 'TemplateLiteral'
193+
| 'ThisExpression'
194+
| 'ThrowStatement'
195+
| 'TryStatement'
196+
| 'UnaryExpression'
197+
| 'UpdateExpression'
198+
| 'VariableDeclaration'
199+
| 'VariableDeclarator'
200+
| 'WhileStatement'
201+
| 'WithStatement'
154202
| 'YieldExpression'
155203
// JSX
156-
| 'JSXAttribute' | 'JSXClosingElement' | 'JSXClosingFragment'
157-
| 'JSXElement' | 'JSXEmptyExpression' | 'JSXExpressionContainer'
158-
| 'JSXFragment' | 'JSXIdentifier' | 'JSXMemberExpression'
159-
| 'JSXNamespacedName' | 'JSXOpeningElement' | 'JSXOpeningFragment'
160-
| 'JSXSpreadAttribute' | 'JSXSpreadChild' | 'JSXText'
204+
| 'JSXAttribute'
205+
| 'JSXClosingElement'
206+
| 'JSXClosingFragment'
207+
| 'JSXElement'
208+
| 'JSXEmptyExpression'
209+
| 'JSXExpressionContainer'
210+
| 'JSXFragment'
211+
| 'JSXIdentifier'
212+
| 'JSXMemberExpression'
213+
| 'JSXNamespacedName'
214+
| 'JSXOpeningElement'
215+
| 'JSXOpeningFragment'
216+
| 'JSXSpreadAttribute'
217+
| 'JSXSpreadChild'
218+
| 'JSXText'
161219
// TS-specific (composite types)
162-
| 'TSAbstractAccessorProperty' | 'TSAbstractKeyword'
163-
| 'TSAbstractMethodDefinition' | 'TSAbstractPropertyDefinition'
164-
| 'TSArrayType' | 'TSAsExpression' | 'TSCallSignatureDeclaration'
165-
| 'TSClassImplements' | 'TSConditionalType'
166-
| 'TSConstructSignatureDeclaration' | 'TSConstructorType'
167-
| 'TSDeclareFunction' | 'TSEmptyBodyFunctionExpression'
168-
| 'TSEnumBody' | 'TSEnumDeclaration' | 'TSEnumMember'
169-
| 'TSExportAssignment' | 'TSExternalModuleReference'
170-
| 'TSFunctionType' | 'TSImportEqualsDeclaration' | 'TSImportType'
171-
| 'TSIndexSignature' | 'TSIndexedAccessType' | 'TSInferType'
172-
| 'TSInstantiationExpression' | 'TSInterfaceBody'
173-
| 'TSInterfaceDeclaration' | 'TSInterfaceHeritage'
174-
| 'TSIntersectionType' | 'TSLiteralType' | 'TSMappedType'
175-
| 'TSMethodSignature' | 'TSModuleBlock' | 'TSModuleDeclaration'
176-
| 'TSNamedTupleMember' | 'TSNamespaceExportDeclaration'
177-
| 'TSNonNullExpression' | 'TSOptionalType' | 'TSParameterProperty'
178-
| 'TSPropertySignature' | 'TSQualifiedName' | 'TSRestType'
179-
| 'TSSatisfiesExpression' | 'TSTemplateLiteralType' | 'TSThisType'
180-
| 'TSTupleType' | 'TSTypeAliasDeclaration' | 'TSTypeAnnotation'
181-
| 'TSTypeAssertion' | 'TSTypeLiteral' | 'TSTypeOperator'
182-
| 'TSTypeParameter' | 'TSTypeParameterDeclaration'
183-
| 'TSTypeParameterInstantiation' | 'TSTypePredicate' | 'TSTypeQuery'
184-
| 'TSTypeReference' | 'TSUnionType'
220+
| 'TSAbstractAccessorProperty'
221+
| 'TSAbstractKeyword'
222+
| 'TSAbstractMethodDefinition'
223+
| 'TSAbstractPropertyDefinition'
224+
| 'TSArrayType'
225+
| 'TSAsExpression'
226+
| 'TSCallSignatureDeclaration'
227+
| 'TSClassImplements'
228+
| 'TSConditionalType'
229+
| 'TSConstructSignatureDeclaration'
230+
| 'TSConstructorType'
231+
| 'TSDeclareFunction'
232+
| 'TSEmptyBodyFunctionExpression'
233+
| 'TSEnumBody'
234+
| 'TSEnumDeclaration'
235+
| 'TSEnumMember'
236+
| 'TSExportAssignment'
237+
| 'TSExternalModuleReference'
238+
| 'TSFunctionType'
239+
| 'TSImportEqualsDeclaration'
240+
| 'TSImportType'
241+
| 'TSIndexSignature'
242+
| 'TSIndexedAccessType'
243+
| 'TSInferType'
244+
| 'TSInstantiationExpression'
245+
| 'TSInterfaceBody'
246+
| 'TSInterfaceDeclaration'
247+
| 'TSInterfaceHeritage'
248+
| 'TSIntersectionType'
249+
| 'TSLiteralType'
250+
| 'TSMappedType'
251+
| 'TSMethodSignature'
252+
| 'TSModuleBlock'
253+
| 'TSModuleDeclaration'
254+
| 'TSNamedTupleMember'
255+
| 'TSNamespaceExportDeclaration'
256+
| 'TSNonNullExpression'
257+
| 'TSOptionalType'
258+
| 'TSParameterProperty'
259+
| 'TSPropertySignature'
260+
| 'TSQualifiedName'
261+
| 'TSRestType'
262+
| 'TSSatisfiesExpression'
263+
| 'TSTemplateLiteralType'
264+
| 'TSThisType'
265+
| 'TSTupleType'
266+
| 'TSTypeAliasDeclaration'
267+
| 'TSTypeAnnotation'
268+
| 'TSTypeAssertion'
269+
| 'TSTypeLiteral'
270+
| 'TSTypeOperator'
271+
| 'TSTypeParameter'
272+
| 'TSTypeParameterDeclaration'
273+
| 'TSTypeParameterInstantiation'
274+
| 'TSTypePredicate'
275+
| 'TSTypeQuery'
276+
| 'TSTypeReference'
277+
| 'TSUnionType'
185278
// TS keyword types (TypeKeywordNode dynamic dispatch)
186-
| 'TSAnyKeyword' | 'TSBigIntKeyword' | 'TSBooleanKeyword'
187-
| 'TSIntrinsicKeyword' | 'TSNeverKeyword' | 'TSNullKeyword'
188-
| 'TSNumberKeyword' | 'TSObjectKeyword' | 'TSStringKeyword'
189-
| 'TSSymbolKeyword' | 'TSUndefinedKeyword' | 'TSUnknownKeyword'
279+
| 'TSAnyKeyword'
280+
| 'TSBigIntKeyword'
281+
| 'TSBooleanKeyword'
282+
| 'TSIntrinsicKeyword'
283+
| 'TSNeverKeyword'
284+
| 'TSNullKeyword'
285+
| 'TSNumberKeyword'
286+
| 'TSObjectKeyword'
287+
| 'TSStringKeyword'
288+
| 'TSSymbolKeyword'
289+
| 'TSUndefinedKeyword'
290+
| 'TSUnknownKeyword'
190291
| 'TSVoidKeyword';
191292

192293
function getLocFor(ast: ts.SourceFile, start: number, end: number) {
@@ -2361,10 +2462,18 @@ class TSTypeAnnotationNode extends LazyNode {
23612462
// subset so the constructor's `type` parameter can't accept a
23622463
// non-keyword name by mistake.
23632464
type TypeKeyword =
2364-
| 'TSAnyKeyword' | 'TSBigIntKeyword' | 'TSBooleanKeyword'
2365-
| 'TSIntrinsicKeyword' | 'TSNeverKeyword' | 'TSNullKeyword'
2366-
| 'TSNumberKeyword' | 'TSObjectKeyword' | 'TSStringKeyword'
2367-
| 'TSSymbolKeyword' | 'TSUndefinedKeyword' | 'TSUnknownKeyword'
2465+
| 'TSAnyKeyword'
2466+
| 'TSBigIntKeyword'
2467+
| 'TSBooleanKeyword'
2468+
| 'TSIntrinsicKeyword'
2469+
| 'TSNeverKeyword'
2470+
| 'TSNullKeyword'
2471+
| 'TSNumberKeyword'
2472+
| 'TSObjectKeyword'
2473+
| 'TSStringKeyword'
2474+
| 'TSSymbolKeyword'
2475+
| 'TSUndefinedKeyword'
2476+
| 'TSUnknownKeyword'
23682477
| 'TSVoidKeyword';
23692478
class TypeKeywordNode extends LazyNode {
23702479
readonly type: TypeKeyword;

0 commit comments

Comments
 (0)