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: if no trailing comma, not to leave trailing comma after fixed of order-in-components #569

Merged
merged 3 commits into from
Sep 18, 2018

Conversation

ota-meshi
Copy link
Member

Fixed #566

This pull request, if there is no trailing comma, make sure vue/order-in-components does not leave trailing comma after autofix.

Until now, after moving the target property up, we did not delete the last comma of the previous property. because of this, if the target property is the last property, the trailing comma will always remain.

With this fix, autofix will no conflict with "comma-dangle": ["error", "always"].

// If we can upgrade requirements to `eslint@>4.1.0`, this code can be replaced by:
// return [
// fixer.removeRange([codeStart, codeEnd]),
// fixer.removeRange([removeStart, codeEnd]),
Copy link
Member

Choose a reason for hiding this comment

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

We already updated to ESLint >=5 so we can use the above shorthand ☝️

@ota-meshi
Copy link
Member Author

@michalsnik Thank you for review!
I changed it to use shorthand fixer.

@michalsnik
Copy link
Member

Good job @ota-meshi 👍

@michalsnik michalsnik merged commit b1e1bb9 into master Sep 18, 2018
@michalsnik michalsnik deleted the issues566 branch September 18, 2018 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Order-in-components breaks autofix of comma-dangle
2 participants