mtth / avsc

Avro for JavaScript :zap:
MIT License
1.27k stars 147 forks source link

Convert codebase to ES6 and reduce dependency on Node-specific modules #422

Closed valadaptive closed 1 year ago

valadaptive commented 1 year ago

This PR does a few things:

valadaptive commented 1 year ago

Did you use a tool to do the translation? I'm curious how difficult it would be to swap the lets for consts where possible.

The translation to ES6 class syntax was done manually. The translation from var to let was done by enabling ESLint's no-var rule, letting ESLint autofix as many cases as possible and manually going over the rest.

There are tools like lebab that can automatically convert to ES6 classes as well, but it seems much less well-maintained than ESLint, so I opted to go with ESLint + the manual approach.

It should be fairly easy to use const where possible--ESLint has a prefer-const rule which has an autofix available.

mtth commented 1 year ago

Thank you very much for this @valadaptive! Follow up release PR: https://github.com/mtth/avsc/pull/428