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

Fix: missing visitor-keys #554

Merged
merged 3 commits into from
Nov 20, 2018
Merged

Fix: missing visitor-keys #554

merged 3 commits into from
Nov 20, 2018

Conversation

armano2
Copy link
Contributor

@armano2 armano2 commented Nov 17, 2018

This PR allows visiting

  • typeParameters in TSInterfaceDeclaration
  • decorators in Identifier
  • parameters in TSFunctionType

there is way way more missing properties in visitor tree, but this is going to unblock
eslint-plugin-typescript from upgrading to latest version

bradzacher/eslint-plugin-typescript#174

@jsf-clabot
Copy link

jsf-clabot commented Nov 17, 2018

CLA assistant check
All committers have signed the CLA.

@armano2 armano2 changed the title TSInterfaceDeclaration can have typeParameters Fix: missing typeParameters in TSInterfaceDeclaration Nov 17, 2018
@armano2 armano2 changed the title Fix: missing typeParameters in TSInterfaceDeclaration Fix: missing visitor-keys in TSInterfaceDeclaration and TSFunctionType Nov 17, 2018
@mysticatea mysticatea self-requested a review November 18, 2018 17:59
@armano2 armano2 changed the title Fix: missing visitor-keys in TSInterfaceDeclaration and TSFunctionType Fix: missing visitor-keys Nov 19, 2018
@mysticatea
Copy link
Member

Thank you for this PR!

Would you update the code in order to visit AST in the location order?
For example, it should visit decorators before type annotations.

For visitorKeys, ESLint visits the order as same as the visitorKeys array order.

- typeParameters in TSInterfaceDeclaration
- decorators in Identifier
- parameters in TSFunctionType
@armano2
Copy link
Contributor Author

armano2 commented Nov 20, 2018

@mysticatea thank you, code updated

Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
Almost looks good to me, but I have a few concerns.

visitor-keys.js Outdated Show resolved Hide resolved
tests/lib/__snapshots__/scope-analysis.js.snap Outdated Show resolved Hide resolved
Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you so much!

@mysticatea mysticatea merged commit ae7c4e6 into eslint:master Nov 20, 2018
@armano2 armano2 deleted the patch-1 branch November 20, 2018 02:27
@armano2
Copy link
Contributor Author

armano2 commented Nov 20, 2018

@mysticatea tomorrow i'm going to make a ticket listing all (or most) of missing fields in visitor, there is few of them :>

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

Successfully merging this pull request may close these issues.

3 participants