digidem / mapeo-core-next

The upcoming version of Mapeo Core
MIT License
7 stars 1 forks source link

chore: replace `var` with `let` and `const` #613

Closed EvanHahn closed 3 weeks ago

EvanHahn commented 2 months ago

This enables the ESLint no-var rule and fixes all violations.

Most of the changes were mechanical but a few required a small amount of work.

EvanHahn commented 1 month ago

This was initially vendored from Holepunch but it's changed so much that I think it's become a separate thing. I don't feel strongly, but I think dropping var is worth it here, especially because we already have in several places in this file.

Alternatively, we could disable the rule for this file. Again, I don't feel strongly.

achou11 commented 3 weeks ago

fine by me. FWIW using var inside try...catch was deliberate, I remember discussing with someone on the team the best pattern for assigning variables in a try...catch. I'm not beholden to that pattern though.

that someone was me - also fine with abandoning that pattern 😄