eslint / typescript-eslint-parser

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

Support `TSParenthesizedExpression` #464

Closed ikatyang closed 6 years ago

ikatyang commented 6 years ago

What version of TypeScript are you using? 2.8.1

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

What code were you trying to parse?

var newArray = /** @type {Array} */ (numberOrString).map(x => x);

What did you expect to happen? TSParenthesizedExpression should exist since it's used by TypeScript's checkJS mode, see also prettier/prettier#4287.

What happened? not exist

ikatyang commented 6 years ago

I guess we can simply add a parenthesized: boolean prop for expressions so that the AST structure won't be affected.

ikatyang commented 6 years ago

Just found another way to fix the problem in Prettier (prettier/prettier#4648).