-
Notifications
You must be signed in to change notification settings - Fork 397
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
Sort all the props \o/ #5760
Sort all the props \o/ #5760
Conversation
Codecov Report
@@ Coverage Diff @@
## master mozilla/addons-frontend#5760 +/- ##
=======================================
Coverage 97.25% 97.25%
=======================================
Files 228 228
Lines 5678 5678
Branches 1091 1091
=======================================
Hits 5522 5522
Misses 136 136
Partials 20 20
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a terrible idea for the cognitive burden it will impose but if other team members feel it will be helpful, can we at least do it only for multi-line destructors?
For example, this is all on one line so I really don't see why anyone needs to read it in alphabetical order:
const { one, two, three } = stuff;
but multi-line destructors can get quite long and I can see how alphabetizing is more helpful:
const {
one,
three,
two,
} = stuff;
What is the main problem alphabetizing solves? Editors have powerful find features so that doesn't seem like a problem to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t have a preference really one way. I just thought that this was the general consensus that this should be done (for readability) so in that way I see how this could be really helpful if this is something we were going to push.
If everyone's okay with the multi-line at least, maybe for now we could start with this?
This would be tricky to automate because ESLint does not really know whether a statement has newlines or not (it is all about the syntax). |
Maybe it could count characters or words to guess whether or not it will span multiple lines? |
I'm going to close this PR for now. I leave the ticket open though. |
Fix mozilla/addons#12138
eslint-plugin-amo
to version1.5.0
eslint --fix
to automatically sort all the destructured props