lodestar icon indicating copy to clipboard operation
lodestar copied to clipboard

`yarn check-types` builds a production bundle and creates untracked files

Open nflaig opened this issue 9 months ago • 5 comments

Since we merged https://github.com/ChainSafe/lodestar/pull/6685, running yarn check-types has become really slow and at the same time also creates untracked files (see https://github.com/ChainSafe/lodestar/pull/6685#discussion_r1586631639)

My suggestion is to either revert the PR or come up with a proper solution as of right now this negatively affects developer experience.

It also fails randomly locally, and even in the CI (see https://github.com/ChainSafe/lodestar/pull/6685#discussion_r1586635384)

  • [x] fix build error
  • [x] no more untracked files as side effect of running build
  • [ ] yarn lint should consistently pass, irrespective of running yarn check-types before
  • [ ] move build out of yarn check-types to speed up time to run yarn check-types by 25%-30%

nflaig avatar May 02 '24 22:05 nflaig

Noticed something else, running yarn lint before yarn check-types causes no issues. But if check-types is executed once locally, any lint runs will fail with the following

/home/nico/projects/ethereum/lodestar/packages/light-client/test/unit/webEsmBundle.browser.test.ts
  1:1  error  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-unsafe-call')

nflaig avatar May 03 '24 17:05 nflaig

yarn lint should consistently pass, irrespective of running yarn check-types before

That depends upon what lint is doing. We are doing linting on both src and tests. And when you lint test which are depending upon the build artifacts then you have to build first before linting.

nazarhussain avatar May 06 '24 14:05 nazarhussain

move build out of yarn check-types to speed up time to run yarn check-types by 2x (or more)

That's for one package where needed and not for all packages. So in paractivce it's not slowing down 2x.

nazarhussain avatar May 06 '24 14:05 nazarhussain

lint test which are depending upon the build artifacts

this is such a bad design, lint should never depend on build...and it never has until now.

Also right now it's vice versa, just running yarn lint will pass but if you run yarn check-types once locally, any yarn lint afterwards will fail (just give this a try yourself locally)

nflaig avatar May 06 '24 14:05 nflaig

So in paractivce it's not slowing down 2x.

I meant by 50% but it's more like 25-30%, this is still bad enough imo

nflaig avatar May 06 '24 14:05 nflaig

Issue seems to be resolved, having a smooth DX on unstable branch now, thanks @nazarhussain :heart:

nflaig avatar Aug 03 '24 11:08 nflaig