Skip to content
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

investigate using prefer-const or no-var rules to change all var usages #1012

Closed
zepumph opened this issue Sep 19, 2019 · 1 comment
Closed
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Sep 19, 2019

From #1010. We could use the "fix" option during lint to convert a lot of usages. If we get lucky we may be able to fix all of them.

@zepumph zepumph self-assigned this Sep 19, 2019
zepumph added a commit to phetsims/reactants-products-and-leftovers that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/equality-explorer-two-variables that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/balloons-and-static-electricity that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/balancing-chemical-equations that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/gene-expression-essentials that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/masses-and-springs-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/inverse-square-law-common that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/area-model-multiplication that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/forces-and-motion-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/least-squares-regression that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/isotopes-and-atomic-mass that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/graphing-slope-intercept that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/equality-explorer-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/energy-skate-park-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/function-builder-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/states-of-matter-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/area-model-introduction that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/molecule-shapes-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/rutherford-scattering that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/proportion-playground that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/resistance-in-a-wire that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/query-string-machine that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/capacitor-lab-basics that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/acid-base-solutions that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/molecules-and-light that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/fraction-comparison that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/expression-exchange that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/atomic-interactions that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/axon that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/sun that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/dot that referenced this issue Sep 19, 2019
@zepumph
Copy link
Member Author

zepumph commented Sep 19, 2019

After the above commits. There are now "only" 600 usages of var in js code. This feels like a relatively small number considering our code base. By glancing at some usages, it looks like for the most part these are the weird cases where there is potential for hoisting loops etc. I don't think I need to spend any more time on this personally. If there was going to be more work done. I think we could next find and replace all var usages for let. Then auto fix most back to const using prefer-const. Then sort out the rest of them (some may fail because let is not exactly the same as var).

@zepumph zepumph closed this as completed Sep 19, 2019
zepumph added a commit to phetsims/chipper that referenced this issue Sep 19, 2019
zepumph added a commit to phetsims/balloons-and-static-electricity that referenced this issue Sep 20, 2019
zepumph added a commit to phetsims/energy-skate-park that referenced this issue Sep 20, 2019
zepumph added a commit to phetsims/states-of-matter that referenced this issue Sep 20, 2019
zepumph added a commit to phetsims/area-builder that referenced this issue Sep 20, 2019
zepumph added a commit to phetsims/arithmetic that referenced this issue Sep 20, 2019
zepumph added a commit to phetsims/ph-scale that referenced this issue Sep 20, 2019
zepumph added a commit to phetsims/scenery that referenced this issue Sep 20, 2019
zepumph added a commit to phetsims/axon that referenced this issue Sep 20, 2019
zepumph added a commit to phetsims/dot that referenced this issue Sep 20, 2019
zepumph added a commit to phetsims/gravity-force-lab that referenced this issue Oct 14, 2019
zepumph added a commit to phetsims/scenery that referenced this issue Oct 14, 2019
zepumph added a commit to phetsims/scenery that referenced this issue Oct 14, 2019
zepumph added a commit to phetsims/sun that referenced this issue Oct 14, 2019
zepumph added a commit to phetsims/utterance-queue that referenced this issue Oct 22, 2019
zepumph added a commit to phetsims/utterance-queue that referenced this issue Oct 22, 2019
jessegreenberg pushed a commit to phetsims/greenhouse-effect that referenced this issue Apr 21, 2021
jessegreenberg pushed a commit to phetsims/greenhouse-effect that referenced this issue Apr 21, 2021
chrisklus pushed a commit to phetsims/counting-common that referenced this issue Jun 4, 2021
zepumph added a commit to phetsims/scenery that referenced this issue Dec 15, 2021
samreid pushed a commit to phetsims/scenery-phet that referenced this issue Apr 9, 2022
marlitas pushed a commit to phetsims/scenery-phet that referenced this issue Jun 22, 2022
marlitas pushed a commit to phetsims/sun that referenced this issue Jun 28, 2022
marlitas pushed a commit to phetsims/scenery-phet that referenced this issue Mar 2, 2024
zepumph added a commit to phetsims/perennial that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant