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

Fix: arrow-parens fixer gets tripped up with trailing comma in args #8838

Merged
merged 2 commits into from Jun 29, 2017

Conversation

aladdin-add
Copy link
Member

@aladdin-add aladdin-add commented Jun 29, 2017

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

[x] Bug fix (template)

What changes did you make? (Give an overview)
fixes #8834

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

@eslintbot
Copy link

LGTM

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

Left a suggestion for simplifying things a bit.

@@ -66,7 +66,13 @@ module.exports = {
*/
function fixParamsWithParenthesis(fixer) {
const paramToken = sourceCode.getTokenAfter(firstTokenOfParam);
const closingParenToken = sourceCode.getTokenAfter(paramToken);
let closingParenToken = sourceCode.getTokenAfter(paramToken);
Copy link
Member

Choose a reason for hiding this comment

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

Can we use a predicate here instead of using the if statement below? Maybe something like sourceCode.getTokenAfter(paramToken, astUtils.isClosingParenToken)?

Copy link
Member Author

Choose a reason for hiding this comment

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

great, I'm just looking for something like this. thanks~~

@eslintbot
Copy link

LGTM

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!

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

arrow-parens fixer gets tripped up with trailing comma in args
6 participants