igneous-labs / stake-pool-sdk

Socean Stake Pool Typescript SDK
stake-pool-sdk.vercel.app
MIT License
7 stars 3 forks source link

Add prettier, eslint, husky and lintstaged #66

Closed Johnnycus closed 2 years ago

Johnnycus commented 2 years ago

ESLint suggests replacing for...in with array loops so I added // TODO comments there. Or we can turn that rule off.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/igneous-labs/stake-pool-sdk/7XGmS8DqezuNqyeSDzUgftoziSHY
✅ Preview: https://stake-pool-sdk-git-feat-pre-commit-eslint-prettier-igneous-labs.vercel.app

billythedummy commented 2 years ago

ESLint suggests replacing for...in with array loops so I added // TODO comments there. Or we can turn that rule off.

Lets keep that rule, there seems to be only 1 instance where for (... in ...) is used and thats in reverse() in stake-pool/utils.ts. Could you refactor that to iterate Object.keys() instead? Thanks!

Johnnycus commented 2 years ago

ESLint suggests replacing for...in with array loops so I added // TODO comments there. Or we can turn that rule off.

Lets keep that rule, there seems to be only 1 instance where for (... in ...) is used and thats in reverse() in stake-pool/utils.ts. Could you refactor that to iterate Object.keys() instead? Thanks!

Done, there were also some instances of for...of which I also replaced with forEach. I only kept one for...of that had async/await. We can replace it with map, but this will run them in parallel