bitcoinjs-lib icon indicating copy to clipboard operation
bitcoinjs-lib copied to clipboard

Implemented Eslint to remove deprecated Tslint

Open fzuleta opened this issue 3 years ago • 4 comments
trafficstars

Summary

  • Created .eslintrc to match previous rules
  • Made eslint/prettier work together
  • ran lint on src, ts_src and test
  • made sure all existing tests pass

This is rather a monster PR, let me know, happy to iterate on it, or if there's no interest it's ok to close it too.

fzuleta avatar Aug 26 '22 21:08 fzuleta

You will likely want to match the current tslint config rules ("arrow-parens": false for example) to keep the diff as small as possible. Then make subsequent PR's to add whatever linting rule changes you'd like.

Concept ACK

grunklejp avatar Sep 01 '22 20:09 grunklejp

You will likely want to match the current tslint config rules ("arrow-parens": false for example) to keep the diff as small as possible. Then make subsequent PR's to add whatever linting rule changes you'd like.

I agree with John here.

  1. Concept ACK
  2. I want to merge and release taproot first (so that @motorina0 won't have to deal with all the merge conflicts)

junderw avatar Sep 01 '22 21:09 junderw

Out of office. I will try to wrap-up the taproot PR by the end of next week. Thanks!

On Thu, Sep 1, 2022, 11:49 PM Jonathan Underwood @.***> wrote:

You will likely want to match the current tslint config rules ("arrow-parens": false for example) to keep the diff as small as possible. Then make subsequent PR's to add whatever linting rule changes you'd like.

I agree with John here.

  1. Concept ACK
  2. I want to merge and release taproot first (so that @motorina0 https://github.com/motorina0 won't have to deal with all the merge conflicts)

— Reply to this email directly, view it on GitHub https://github.com/bitcoinjs/bitcoinjs-lib/pull/1831#issuecomment-1234817107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWQR3RAN3DOSGFOEDHZ7STV4EQFTANCNFSM57YCYCPQ . You are receiving this because you were mentioned.Message ID: @.***>

motorina0 avatar Sep 02 '22 08:09 motorina0

sounds good, I'll wait for taproot merge,

arrow-parens

funny enough :sweat_smile: , this one caused an interesting conflict between es-lint and prettier, since prettier recommends here to have it enabled.

But I absolutely understand the impact, will iterate on it to minimize risk

fzuleta avatar Sep 02 '22 16:09 fzuleta

Sorry for the big diff!

Merged taproot. Please rebase and I'll merge this. Thanks!

junderw avatar Nov 29 '22 09:11 junderw

hi @junderw did a rebase and pushed, here's a few notes since it's still affecting so many files

  • With ESlint rules I could pretty much mirror old tslint rules.
  • When applying Prettier rules ontop of eslint, I could not mirror them 😞 , since Prettier is highly opinionated, things like multiple imports/exports per line, or extra spaces [..] vs [....] throw errors and Prettier devs didnt give us a disable flag, so I had to jump in and fix formatting on a few files.

let me know what you think, Im happy to continue iterating on it

edit: FYI, I also updated the package-lock deps after upgrading prettier and installing eslint, and did run snyk test on the project locally with no vulnerabilities found

fzuleta avatar Dec 05 '22 17:12 fzuleta