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

style: var -> let and const codemod #4444

Closed
wants to merge 9 commits into from
Closed

style: var -> let and const codemod #4444

wants to merge 9 commits into from

Commits on May 3, 2024

  1. style: var -> let and const codemod

    adds `no-var` rule to eslint
    
    Who else does this?
      - Google (JS style guide) https://google.github.io/styleguide/jsguide.html#features-local-variable-declarations
      - Airbnb (popular JS style guide) https://github.com/airbnb/javascript
    
    Why do this?
    
    Gaiety's explanation: "`let` works the way most devs think `var` works.
    scope leaking and variable hoisting is a messy confusing idea, JS got
    updated for a reason" also it's 2024, this isn't too controversial
    anymore
    
    - https://www.freecodecamp.org/news/var-let-and-const-whats-the-difference/
    - https://blog.javascripttoday.com/blog/var-vs-let-vs-const/ "The var
      keyword was originally used for declaring variables in JavaScript. If
      you’ve browsed an old codebase or an older JavaScript tutorial, you
      have probably seen it."
    - https://medium.com/@rithinmenezes/understanding-let-var-and-const-in-javascript-a-guide-to-variable-declarations-f271c5b8dc79
    - Airbnb's why https://airbnb.io/javascript/#variables
    gaiety-deque committed May 3, 2024
    Configuration menu
    Copy the full SHA
    47898db View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8b160b7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    393bc6f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    76a03cc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    090eb2a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6467d51 View commit details
    Browse the repository at this point in the history
  7. var to let post-merge

    gaiety-deque committed May 3, 2024
    Configuration menu
    Copy the full SHA
    9990a8c View commit details
    Browse the repository at this point in the history
  8. correct typo

    gaiety-deque committed May 3, 2024
    Configuration menu
    Copy the full SHA
    909ec1c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    664568a View commit details
    Browse the repository at this point in the history