Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: add isValidThisArg in ast-utils. #9500

Merged
merged 3 commits into from
Nov 6, 2017

Conversation

aladdin-add
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[x] Other, please explain:

What changes did you make? (Give an overview)
isValidThisArg is used both in no-useless-call.js and prefer-spread.js. placed it in ast-utils in case some other rules will use it.

Is there anything you'd like reviewers to focus on?

@eslintbot
Copy link

LGTM

@aladdin-add aladdin-add changed the title Chore: refactor ast-utils isValidThisArg. Chore: add isValidThisArg in ast-utils. Oct 22, 2017
@eslintbot
Copy link

LGTM

@aladdin-add aladdin-add reopened this Oct 22, 2017
@aladdin-add aladdin-add added the chore This change is not user-facing label Oct 22, 2017
Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This seems like a good idea to me, but I do think we need to add tests for any public methods we add to ast-utils. Can you add a suite of tests for isValidThisArg?

@not-an-aardvark
Copy link
Member

IMO, it might be better to export equalTokens from ast-utils rather than isValidThisArg, because equalTokens seems like it's more useful in general. But I'm fine with either.

@aladdin-add
Copy link
Member Author

IMO, it might be better to export equalTokens from ast-utils rather than isValidThisArg, because equalTokens seems like it's more useful in general.

maybe we can export both?

@not-an-aardvark
Copy link
Member

I'm fine with that too, although I think isValidThisArg is fairly small and situational compared to equalTokens.

@kaicataldo
Copy link
Member

I'm fine with both too as long as we have test coverage :)

@aladdin-add
Copy link
Member Author

@not-an-aardvark @kaicataldo updated the PR to export equalTokens, and added tests.

Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for contributing.

@aladdin-add aladdin-add merged commit 9064b9c into eslint:master Nov 6, 2017
@aladdin-add aladdin-add deleted the chore/isValidThisArg branch November 6, 2017 03:13
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators May 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants