Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Incorrect optional flag on Identifier #289

Closed
vjeux opened this issue May 24, 2017 · 1 comment
Closed

Incorrect optional flag on Identifier #289

vjeux opened this issue May 24, 2017 · 1 comment
Labels

Comments

@vjeux
Copy link

vjeux commented May 24, 2017

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

What code were you trying to parse?

class X {
  private scanner? = undefined;
}

What did you expect to happen?

undefined not having optional: true

What happened?

{ type: 'Identifier',
  range: [ 47, 56 ],
  loc: { start: { line: 2, column: 23 }, end: { line: 2, column: 32 } },
  name: 'undefined',
  optional: true }

this makes prettier print is as

class SemicolonWalker {
  private scanner? = undefined?;
}

which isn't valid

@soda0289
Copy link
Member

Good catch, thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants