eslint / typescript-eslint-parser

An ESLint custom parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code.
Other
915 stars 75 forks source link

Wrong AST type in LHS of AssignmentExpression #467

Closed mysticatea closed 6 years ago

mysticatea commented 6 years ago

What version of TypeScript are you using?

2.8.1

What version of typescript-eslint-parser are you using?

15.0.0

What code were you trying to parse?

foo({}).x = 1

http://astexplorer.net/#/gist/6d732ddcc3b1d7d09d74c7f3f2ee802b/094e60c05037e1502789340402db35c0dd835b1b

What did you expect to happen?

The {} in above code is an ObjectExpression.

What happened?

The {} in above code is an ObjectPattern.

And it's same for ArrayExpression/ArrayPattern.

JamesHenry commented 6 years ago

Thanks, @mysticatea! Is there any chance you could submit a fix for this?

JamesHenry commented 6 years ago

Ported here: https://github.com/JamesHenry/typescript-estree/issues/8