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
Set a consistent and readable variable name for Array#reduce accumulator variable #7378
Comments
Hey, |
Hi there! I'm new to GitHub and would like to work on this problem, but because I don't have enough experience me and my classmate @jpjjulie decide to work together on this issue and split the work between 2 of us. Thank you |
In addition to changes within the current codebase, we should want to consider how to document the coding standard. Possible locations:
Could make for a good topic of the weekly JavaScript chat. |
@gziolo what needs documenting here? |
It's all about using good names for variables, it's a very specific use case so I don't know if we need to explicitly document it. Example usage: gutenberg/packages/blocks/src/api/registration.js Lines 342 to 353 in 6b75d2e
In other places, the names can be different, but they still contain the gutenberg/packages/block-editor/src/components/font-sizes/with-font-sizes.js Lines 41 to 49 in 6b75d2e
We have local coding guidelines for Gutenberg at: https://github.com/WordPress/gutenberg/blob/trunk/docs/contributors/code/coding-guidelines.md General coding standards for JavaScript have a very short section about naming conventions at https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/#naming-conventions. We could also close the ticket at this point. |
Thanks for the feedback, @gziolo. We'll close this for now. We can work to improve coding standard guidelines later if there seems to be a need. |
I pointed out (in #6782 (comment)) that we used
settersAcc
as the accumulator variable in some code and it wasn't obvious what it was from reading the code.@aduth pointed out we are quite inconsistent with this variable: #6782 (comment)
It'd be nice to go through and clean these up:
accumulator
in the variable name (maybe make that the variable name suffix all the time).The text was updated successfully, but these errors were encountered: