Bug: ast-spec should allow AwaitExpression and NewExpression in LeftHandSideExpression #6239
Closed
4 tasks done
Labels
duplicate
This issue or pull request already exists
Before You File a Bug Report Please Confirm You Have Done The Following...
Relevant Package
ast-spec
Playground Link
https://typescript-eslint.io/play/#ts=4.9.3&sourceType=module&showAST=es&code=MYewdgzgLgBApgDwIYFsAOAbOMC8MDeAvjEhCWAJ4DcAUDQBRIDuSAlrIqpnAJQB0aAE4g0tRi3YwwcJvGTos-ISNo1EaEINj4YhKkA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkeAhpgObp4VTolHoAebANOBqQSeTMmh4AcgFdUqAMIALdNADWZSmJnohAXxB6gA
Repro Code
ESLint Config
No response
tsconfig
No response
Expected Result
In the type system: the
object
property in theTSESTree.MemberExpression
type is aTSESTree.LeftHandSideExpression
.In the playground's tree: the
object
property on the firstMemberExpression
is anAwaitExpression
. The secondMemberExpression
'sobject
property is aNewExpression
.TSESTree.LeftHandSideExpression
should therefore allowTSESTree.AwaitExpression
andTSESTree.NewExpression
.Actual Result
The
TSESTree.LeftHandSideExpression
union does not includeTSESTree.AwaitExpression
orTSESTree.NewExpression
.Additional Info
Originally spotted in https://github.com/typescript-eslint/typescript-eslint/pull/6028/files#r1032600861
Versions
@typescript-eslint/ast-spec
5.46.1
@typescript-eslint/types
5.46.1
@typescript-eslint/typescript-estree
5.46.1
The text was updated successfully, but these errors were encountered: