swan-bitcoin / xpub-tool

A JavaScript library to derive bitcoin addresses from extended public keys. Includes a web tool and CLI.
MIT License
47 stars 21 forks source link

Add eslint and refactor address derivation input #12

Closed joernroeder closed 4 years ago

joernroeder commented 4 years ago

this PR adds eslint validation rules, auto-formatting of staged code on commit and some more lint scripts. it's based of this article -> https://medium.com/@leandroaps/best-eslintrc-configuration-for-cra-for-now-81753cf39c19 you might need some VS Code plugins but then you're able to cmd + . fix most of the issues. Screenshot 2020-08-27 at 12 44 15

I also went through the AddressDerivationInput and changed mostly prop related code to be more specific. let me know what is unclear and i'll explain in more detail.

you can run npm run lint to get an overview about the eslint issues. eslint also has good docs, therefore searching for a rule like no-use-before-define often gives good background info.