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

Incorrect optional flag on Identifier #289

Closed
@vjeux

Description

@vjeux

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions