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

<object /> uses Keyword type instead of JSXIdentifier #315

Closed
vjeux opened this issue Jun 8, 2017 · 1 comment
Closed

<object /> uses Keyword type instead of JSXIdentifier #315

vjeux opened this issue Jun 8, 2017 · 1 comment
Assignees
Labels

Comments

@vjeux
Copy link

vjeux commented Jun 8, 2017

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

What code were you trying to parse?

<object />

What did you expect to happen?
The object node to be of type JSXIdentifier.

What happened?

It was of type Keyword. We don't handle the type Keyword anywhere else in prettier. Note, this only happens for <object />, <try />... <a />, <div /> are working just fine.

      "expression": {
        "type": "JSXElement",
        "range": [
          0,
          10
        ],
        "loc": {
          "start": {
            "line": 1,
            "column": 0
          },
          "end": {
            "line": 1,
            "column": 10
          }
        },
        "openingElement": {
          "type": "JSXOpeningElement",
          "range": [
            0,
            10
          ],
          "loc": {
            "start": {
              "line": 1,
              "column": 0
            },
            "end": {
              "line": 1,
              "column": 10
            }
          },
          "selfClosing": true,
          "name": {
            "type": "Keyword", // <-----------------
            "start": 1,
            "end": 7,
            "range": [
              1,
              7
            ],
            "loc": {
              "start": {
                "line": 1,
                "column": 1
              },
              "end": {
                "line": 1,
                "column": 7
              }
            },
            "name": "object"
          },
          "attributes": []
        },
        "closingElement": null,
        "children": []
      }
    }
@soda0289
Copy link
Member

soda0289 commented Jun 8, 2017

Thanks for the report. This will probaly effect all valid Identifier keywords:

abstract          as                async             await  
constructor       declare           from              get  
is                module            namespace         of  
require           set               type

@soda0289 soda0289 added bug and removed triage labels Jun 8, 2017
vjeux added a commit to vjeux/prettier that referenced this issue Jun 8, 2017
vjeux added a commit to prettier/prettier that referenced this issue Jun 8, 2017
@soda0289 soda0289 self-assigned this Jun 9, 2017
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