-
Notifications
You must be signed in to change notification settings - Fork 19
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
Prefer arrow callbacks in ES6 code #572
Comments
Seems sensible. Worth posting in https://www.mediawiki.org/wiki/Manual_talk:Coding_conventions/JavaScript for visibility? |
edg2s
added a commit
that referenced
this issue
May 17, 2024
Also prefer single-line body-less style when possible. Fixes #572
edg2s
added a commit
that referenced
this issue
May 21, 2024
Also prefer single-line body-less style when possible. Fixes #572
edg2s
added a commit
that referenced
this issue
May 21, 2024
Also prefer single-line body-less style when possible. Fixes #572
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We should consider the following rules in ES6 code:
This results in arrow functions being used for callbacks (unless they reference
this
orarguments
, in which case they would need be converted manually). When arrow functions contain a single return statement, the body-less style is prefered (e.g.( x ) => x + 1
. Also a single line is prefered for such body-less functions.The text was updated successfully, but these errors were encountered: