-
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
Remove for of
loop from sim code
#972
Comments
See also phetsims/wave-interference#223 |
I recommend to add a lint rule so this syntax doesn't accidentally sneak in. However, once we introduce a lint rule for this, we will need to address the 55 other occurrences of |
Pushed new lint rule that prevents |
Definitely don't want to have to provide an eslint disable for most of my for-loops in Node.js code. How about we deliberately have separate Node.js and browser rules? For example, you never want to reference a global |
Possibility to extend eslintrc files? https://eslint.org/docs/developer-guide/shareable-configs#using-a-shareable-config |
12/13/18 dev meeting: @zepumph will investigate splitting into server (Node) vs browser lint rules. |
I believe everything has been done for this issue. Further work in linked issues above.
@pixelzoom as for the error you pointed out, I have two thoughts.
module.exports = {
extends: './chipper/eslint/.eslintrc.js',
}; Then the linter will fall back to this if no config is found in a given repo. I tested this by adding the file to my repo parent dir, and then checking out BCE 1.2. @pixelzoom let me know if this is something you are interested in pursuing as a workaround. Otherwise feel free to close. |
Thanks for investigating options. I'll live with having to checkout-shas in order to cherry pick. Closing. |
…eConfig`, adding package.json files when needed, phetsims/tasks#972
…eConfig`, adding package.json files when needed, phetsims/tasks#972
It looks like babel transpiles this into using
Symbol
and expects a polyfill. We don't do polyfill that right now. On top of that @jonathanolson says thatforEach
loops are faster even with the closure. As a result we should convert usages to that, and when necessary use the traditionalfor (let i=0; i<length; i++)
.I see 75 usages of
for \( let \b[A-z]*\b of
, though many can stick around because they aren't in sim code. Assigning to responsible devs of these repos.The text was updated successfully, but these errors were encountered: