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.

JSXMemberExpression incorrectly marked as a JSXIdentifier #257

Closed
@azz

Description

@azz

What version of TypeScript are you using?

2.3.2

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

a294afa

What code were you trying to parse?

var foo: Nested.Namespace.Type;

What did you expect to happen?

JSXIdentifier nodes should not have property and object keys. There is one in this AST that should be a JSXMemberExpression.

What happened?

{
  "type": "VariableDeclaration",
  "range": [
    0,
    30
  ],
  "loc": {
    "start": {
      "line": 1,
      "column": 0
    },
    "end": {
      "line": 1,
      "column": 30
    }
  },
  "declarations": [
    {
      "type": "VariableDeclarator",
      "range": [
        4,
        30
      ],
      "loc": {
        "start": {
          "line": 1,
          "column": 4
        },
        "end": {
          "line": 1,
          "column": 30
        }
      },
      "id": {
        "type": "Identifier",
        "range": [
          4,
          7
        ],
        "loc": {
          "start": {
            "line": 1,
            "column": 4
          },
          "end": {
            "line": 1,
            "column": 7
          }
        },
        "name": "foo",
        "typeAnnotation": {
          "type": "TypeAnnotation",
          "loc": {
            "start": {
              "line": 1,
              "column": 9
            },
            "end": {
              "line": 1,
              "column": 30
            }
          },
          "range": [
            9,
            30
          ],
          "typeAnnotation": {
            "type": "TSTypeReference",
            "range": [
              9,
              30
            ],
            "loc": {
              "start": {
                "line": 1,
                "column": 9
              },
              "end": {
                "line": 1,
                "column": 30
              }
            },
            "typeName": {
              "type": "JSXMemberExpression",
              "range": [
                9,
                30
              ],
              "loc": {
                "start": {
                  "line": 1,
                  "column": 9
                },
                "end": {
                  "line": 1,
                  "column": 30
                }
              },
              "object": {
                "type": "JSXIdentifier",
                "range": [
                  9,
                  25
                ],
                "loc": {
                  "start": {
                    "line": 1,
                    "column": 9
                  },
                  "end": {
                    "line": 1,
                    "column": 25
                  }
                },
                "object": {
                  "type": "JSXIdentifier",
                  "range": [
                    9,
                    15
                  ],
                  "loc": {
                    "start": {
                      "line": 1,
                      "column": 9
                    },
                    "end": {
                      "line": 1,
                      "column": 15
                    }
                  },
                  "name": "Nested"
                },
                "property": {
                  "type": "JSXIdentifier",
                  "range": [
                    16,
                    25
                  ],
                  "loc": {
                    "start": {
                      "line": 1,
                      "column": 16
                    },
                    "end": {
                      "line": 1,
                      "column": 25
                    }
                  },
                  "name": "Namespace"
                }
              },
              "property": {
                "type": "JSXIdentifier",
                "range": [
                  26,
                  30
                ],
                "loc": {
                  "start": {
                    "line": 1,
                    "column": 26
                  },
                  "end": {
                    "line": 1,
                    "column": 30
                  }
                },
                "name": "Type"
              }
            }
          }
        }
      },
      "init": null
    }
  ],
  "kind": "var"
}

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