-
Notifications
You must be signed in to change notification settings - Fork 2
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
unnecessary uses of self #26
Comments
No problem removing all uses and declarations of |
@Hyodar These changes are failing lint.
|
There are 2 types of errors above. They are both standard ESlint errors, described here: no-trailing-spaces: https://eslint.org/docs/rules/no-trailing-spaces |
Sorry, sorry! I've already fixed the #48 assertion issue, but I'm running into a bit of problems on my machine's grunt. I'll try to fix them as fast as I can. |
Well, after some struggling with grunt, finally got to run it successfully here. I've actually reinstalled my OS recently, so I had to install it back. WebStorm reformat really wasn't getting those mistakes, it's something to keep an eye out for. Really sorry for the trouble. |
No problem! Everything is working great now, so I'll go ahead and close this. |
Related to #2 (code review):
There are 10 definitions of
self
, and they all appear to be unnecessary.Example in GraphAccordionBox.js:
The use of
self
can generally be avoided by using arrow function notation (a JavaScript feature added in ES6). Arrow function do not create their own context, andthis
therefore refers to the enclosing context. In general, unless you need a context inside of your function, avoidfunction(... ) {...}
and use(...) => {...}
.Using an arrow function, the above example would be:
Recommended to replace
function
with arrow functions throughout the code, and eliminateself
.The text was updated successfully, but these errors were encountered: