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

Fix: Do not mislabel JSXMemberExpression as JSXIdentifier (fixes #257) #258

Merged
merged 1 commit into from
May 21, 2017

Conversation

azz
Copy link
Contributor

@azz azz commented May 6, 2017

No description provided.

@eslintbot
Copy link

LGTM

@JamesHenry
Copy link
Member

@azz Sorry, I'm a bit confused about the test case you have included...

Namely, why is the source necessarily JSX-related at all?

You're A.B.C type could theoretically come from something like this:

namespace A {
    export namespace B {
        export type C = string
    }
}

var foo: A.B.C;

I think we might need to be more sophisticated with our work on SyntaxKind.FirstNode

@soda0289
Copy link
Member

soda0289 commented May 6, 2017

I think typescript no longer uses FirstNode for JSX. I have disabled that code and none of the JSX test fail. @JamesHenry can you find a code example where JSX code uses FirstNode.

I think FirstNode is only used in type references when the Identifier has a period separator.

@azz
Copy link
Contributor Author

azz commented May 7, 2017

@JamesHenry I think I'm also confused. I was under the impression the JSXMemberExpression and JSXIdentifier were just re-used for TypeScript dotted property types (they actually print correctly in prettier).

Maybe it needs to be changed to MemberExpression and Identifier for var x: A.B.C;.

@soda0289
Copy link
Member

soda0289 commented May 7, 2017

@azz I like the idea of using a MemberExpression. We could use that for both of these type annotations:
const foo: a.b.c and const foo: a[b][c].

Unless we want to come up with a new node type. We should define node types for all type annotations since currently I think we just append TS and don't have any handlers.

@soda0289
Copy link
Member

@azz If you have a change could you update the PR to match the babylon produced AST node discussed here:
https://github.com/JamesHenry/tsep-babylon-test/issues/12

@azz azz force-pushed the bug/member-expression branch from 30d3094 to a118511 Compare May 21, 2017 04:00
@eslintbot
Copy link

Thanks for the pull request, @azz! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary must be 72 characters or shorter. Please check out our guide for how to properly format your commit summary and update it on this pull request.

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@azz azz force-pushed the bug/member-expression branch from a118511 to cd732b1 Compare May 21, 2017 04:07
@eslintbot
Copy link

LGTM

@azz
Copy link
Contributor Author

azz commented May 21, 2017

@soda0289 Done. I've only changed SyntaxKind.FirstNode. Was there anything else?

@JamesHenry JamesHenry merged commit 3491b4b into eslint:master May 21, 2017
@azz azz deleted the bug/member-expression branch May 21, 2017 11:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants