ChainSafe / lodestar

🌟 TypeScript Implementation of Ethereum Consensus
https://lodestar.chainsafe.io
Apache License 2.0
1.19k stars 291 forks source link

deps: migrate to biomejs from eslint #7108

Closed nazarhussain closed 1 month ago

nazarhussain commented 1 month ago

Motivation

Improve the performance for development environment. Where no other tool compete linting for biomejs, whole project less than 1s vs 43s.

yarn lint
yarn run v1.22.22
$ biome check packages/*/src packages/*/test
Checked 1664 files in 249ms. No fixes applied.
✨  Done in 0.47s.
yarn lint
yarn run v1.22.22
$ eslint --report-unused-disable-directives --color --ext .ts packages/*/src packages/*/test
✨  Done in 43.63s.

Description

These are the reasons to consider Biomejs for better option.

NOTE:

Noteable difference you may encounter is that in biomejs there is no file level ignore option with code comment. you have to do that in configurations. Reason is that such file level comments never get focused once added.

Steps to test or reproduce

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 37.87879% with 41 lines in your changes missing coverage. Please review.

Project coverage is 49.13%. Comparing base (0d1fd9c) to head (ddd66bb). Report is 9 commits behind head on unstable.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## unstable #7108 +/- ## ============================================ + Coverage 49.04% 49.13% +0.09% ============================================ Files 596 597 +1 Lines 39743 39707 -36 Branches 2065 2084 +19 ============================================ + Hits 19493 19512 +19 + Misses 20209 20154 -55 Partials 41 41 ```
github-actions[bot] commented 1 month ago

Performance Report

✔️ no performance regression detected

Full benchmark results | Benchmark suite | Current: f318f23bf25e106832d67ac2deeac84f54e61269 | Previous: 068fbae928989295706443887c645d476bb95695 | Ratio | |-|-|-|-| | getPubkeys - index2pubkey - req 1000 vs - 250000 vc | 2.2913 ms/op | 2.1370 ms/op | 1.07 | | getPubkeys - validatorsArr - req 1000 vs - 250000 vc | 55.253 us/op | 49.291 us/op | 1.12 | | BLS verify - blst | 1.1401 ms/op | 1.4424 ms/op | 0.79 | | BLS verifyMultipleSignatures 3 - blst | 1.6993 ms/op | 1.2566 ms/op | 1.35 | | BLS verifyMultipleSignatures 8 - blst | 2.3521 ms/op | 2.5203 ms/op | 0.93 | | BLS verifyMultipleSignatures 32 - blst | 5.8748 ms/op | 6.9366 ms/op | 0.85 | | BLS verifyMultipleSignatures 64 - blst | 10.858 ms/op | 11.122 ms/op | 0.98 | | BLS verifyMultipleSignatures 128 - blst | 18.479 ms/op | 17.933 ms/op | 1.03 | | BLS deserializing 10000 signatures | 724.92 ms/op | 697.34 ms/op | 1.04 | | BLS deserializing 100000 signatures | 7.2667 s/op | 7.2298 s/op | 1.01 | | BLS verifyMultipleSignatures - same message - 3 - blst | 905.72 us/op | 1.1015 ms/op | 0.82 | | BLS verifyMultipleSignatures - same message - 8 - blst | 1.2655 ms/op | 1.1840 ms/op | 1.07 | | BLS verifyMultipleSignatures - same message - 32 - blst | 1.8912 ms/op | 1.8230 ms/op | 1.04 | | BLS verifyMultipleSignatures - same message - 64 - blst | 2.7338 ms/op | 2.8011 ms/op | 0.98 | | BLS verifyMultipleSignatures - same message - 128 - blst | 4.5824 ms/op | 4.8989 ms/op | 0.94 | | BLS aggregatePubkeys 32 - blst | 20.457 us/op | 22.005 us/op | 0.93 | | BLS aggregatePubkeys 128 - blst | 72.530 us/op | 76.488 us/op | 0.95 | | notSeenSlots=1 numMissedVotes=1 numBadVotes=10 | 78.067 ms/op | 77.844 ms/op | 1.00 | | notSeenSlots=1 numMissedVotes=0 numBadVotes=4 | 59.991 ms/op | 58.941 ms/op | 1.02 | | notSeenSlots=2 numMissedVotes=1 numBadVotes=10 | 40.632 ms/op | 40.060 ms/op | 1.01 | | getSlashingsAndExits - default max | 109.64 us/op | 143.51 us/op | 0.76 | | getSlashingsAndExits - 2k | 459.60 us/op | 386.24 us/op | 1.19 | | proposeBlockBody type=full, size=empty | 6.2966 ms/op | 7.7443 ms/op | 0.81 | | isKnown best case - 1 super set check | 405.00 ns/op | 629.00 ns/op | 0.64 | | isKnown normal case - 2 super set checks | 419.00 ns/op | 763.00 ns/op | 0.55 | | isKnown worse case - 16 super set checks | 357.00 ns/op | 815.00 ns/op | 0.44 | | InMemoryCheckpointStateCache - add get delete | 3.7910 us/op | 4.1970 us/op | 0.90 | | updateUnfinalizedPubkeys - updating 10 pubkeys | 1.5434 ms/op | 1.5945 ms/op | 0.97 | | updateUnfinalizedPubkeys - updating 100 pubkeys | 4.2965 ms/op | 5.4536 ms/op | 0.79 | | updateUnfinalizedPubkeys - updating 1000 pubkeys | 68.279 ms/op | 65.419 ms/op | 1.04 | | validate api signedAggregateAndProof - struct | 1.7501 ms/op | 1.9236 ms/op | 0.91 | | validate gossip signedAggregateAndProof - struct | 1.7549 ms/op | 1.7809 ms/op | 0.99 | | batch validate gossip attestation - vc 640000 - chunk 32 | 150.09 us/op | 172.99 us/op | 0.87 | | batch validate gossip attestation - vc 640000 - chunk 64 | 119.89 us/op | 143.38 us/op | 0.84 | | batch validate gossip attestation - vc 640000 - chunk 128 | 112.08 us/op | 130.23 us/op | 0.86 | | batch validate gossip attestation - vc 640000 - chunk 256 | 106.24 us/op | 124.52 us/op | 0.85 | | pickEth1Vote - no votes | 1.1010 ms/op | 1.2952 ms/op | 0.85 | | pickEth1Vote - max votes | 6.8653 ms/op | 9.0634 ms/op | 0.76 | | pickEth1Vote - Eth1Data hashTreeRoot value x2048 | 14.720 ms/op | 17.786 ms/op | 0.83 | | pickEth1Vote - Eth1Data hashTreeRoot tree x2048 | 25.049 ms/op | 27.007 ms/op | 0.93 | | pickEth1Vote - Eth1Data fastSerialize value x2048 | 471.93 us/op | 610.27 us/op | 0.77 | | pickEth1Vote - Eth1Data fastSerialize tree x2048 | 3.4658 ms/op | 4.3980 ms/op | 0.79 | | bytes32 toHexString | 443.00 ns/op | 685.00 ns/op | 0.65 | | bytes32 Buffer.toString(hex) | 249.00 ns/op | 302.00 ns/op | 0.82 | | bytes32 Buffer.toString(hex) from Uint8Array | 399.00 ns/op | 523.00 ns/op | 0.76 | | bytes32 Buffer.toString(hex) + 0x | 251.00 ns/op | 310.00 ns/op | 0.81 | | Object access 1 prop | 0.14200 ns/op | 0.20800 ns/op | 0.68 | | Map access 1 prop | 0.13500 ns/op | 0.15700 ns/op | 0.86 | | Object get x1000 | 6.4380 ns/op | 7.1070 ns/op | 0.91 | | Map get x1000 | 6.4880 ns/op | 7.6480 ns/op | 0.85 | | Object set x1000 | 37.630 ns/op | 48.064 ns/op | 0.78 | | Map set x1000 | 27.070 ns/op | 28.569 ns/op | 0.95 | | Return object 10000 times | 0.33080 ns/op | 0.32130 ns/op | 1.03 | | Throw Error 10000 times | 3.7030 us/op | 3.9245 us/op | 0.94 | | toHex | 169.47 ns/op | 191.07 ns/op | 0.89 | | Buffer.from | 147.79 ns/op | 171.29 ns/op | 0.86 | | shared Buffer | 95.254 ns/op | 111.91 ns/op | 0.85 | | fastMsgIdFn sha256 / 200 bytes | 2.3950 us/op | 2.5890 us/op | 0.93 | | fastMsgIdFn h32 xxhash / 200 bytes | 252.00 ns/op | 311.00 ns/op | 0.81 | | fastMsgIdFn h64 xxhash / 200 bytes | 284.00 ns/op | 303.00 ns/op | 0.94 | | fastMsgIdFn sha256 / 1000 bytes | 7.7050 us/op | 8.3090 us/op | 0.93 | | fastMsgIdFn h32 xxhash / 1000 bytes | 387.00 ns/op | 446.00 ns/op | 0.87 | | fastMsgIdFn h64 xxhash / 1000 bytes | 359.00 ns/op | 387.00 ns/op | 0.93 | | fastMsgIdFn sha256 / 10000 bytes | 68.478 us/op | 73.349 us/op | 0.93 | | fastMsgIdFn h32 xxhash / 10000 bytes | 1.9230 us/op | 2.0520 us/op | 0.94 | | fastMsgIdFn h64 xxhash / 10000 bytes | 1.2950 us/op | 1.3330 us/op | 0.97 | | send data - 1000 256B messages | 12.835 ms/op | 15.425 ms/op | 0.83 | | send data - 1000 512B messages | 17.854 ms/op | 20.121 ms/op | 0.89 | | send data - 1000 1024B messages | 27.024 ms/op | 29.612 ms/op | 0.91 | | send data - 1000 1200B messages | 25.206 ms/op | 27.503 ms/op | 0.92 | | send data - 1000 2048B messages | 33.239 ms/op | 34.642 ms/op | 0.96 | | send data - 1000 4096B messages | 30.899 ms/op | 32.127 ms/op | 0.96 | | send data - 1000 16384B messages | 73.956 ms/op | 79.678 ms/op | 0.93 | | send data - 1000 65536B messages | 228.83 ms/op | 236.58 ms/op | 0.97 | | enrSubnets - fastDeserialize 64 bits | 1.2610 us/op | 1.3160 us/op | 0.96 | | enrSubnets - ssz BitVector 64 bits | 391.00 ns/op | 452.00 ns/op | 0.87 | | enrSubnets - fastDeserialize 4 bits | 158.00 ns/op | 186.00 ns/op | 0.85 | | enrSubnets - ssz BitVector 4 bits | 400.00 ns/op | 464.00 ns/op | 0.86 | | prioritizePeers score -10:0 att 32-0.1 sync 2-0 | 178.57 us/op | 177.71 us/op | 1.00 | | prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 | 201.03 us/op | 232.98 us/op | 0.86 | | prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 | 265.99 us/op | 351.90 us/op | 0.76 | | prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 | 460.63 us/op | 524.77 us/op | 0.88 | | prioritizePeers score 0:0 att 64-1 sync 4-1 | 822.86 us/op | 934.84 us/op | 0.88 | | array of 16000 items push then shift | 1.7602 us/op | 1.7718 us/op | 0.99 | | LinkedList of 16000 items push then shift | 8.0770 ns/op | 8.4690 ns/op | 0.95 | | array of 16000 items push then pop | 132.23 ns/op | 143.39 ns/op | 0.92 | | LinkedList of 16000 items push then pop | 7.7000 ns/op | 8.0260 ns/op | 0.96 | | array of 24000 items push then shift | 2.5425 us/op | 2.6293 us/op | 0.97 | | LinkedList of 24000 items push then shift | 8.4980 ns/op | 8.0790 ns/op | 1.05 | | array of 24000 items push then pop | 185.77 ns/op | 186.62 ns/op | 1.00 | | LinkedList of 24000 items push then pop | 7.7100 ns/op | 7.8020 ns/op | 0.99 | | intersect bitArray bitLen 8 | 6.7850 ns/op | 6.7130 ns/op | 1.01 | | intersect array and set length 8 | 54.203 ns/op | 56.580 ns/op | 0.96 | | intersect bitArray bitLen 128 | 31.117 ns/op | 31.262 ns/op | 1.00 | | intersect array and set length 128 | 854.51 ns/op | 891.02 ns/op | 0.96 | | bitArray.getTrueBitIndexes() bitLen 128 | 2.5220 us/op | 2.2070 us/op | 1.14 | | bitArray.getTrueBitIndexes() bitLen 248 | 4.3650 us/op | 4.2670 us/op | 1.02 | | bitArray.getTrueBitIndexes() bitLen 512 | 9.2770 us/op | 10.341 us/op | 0.90 | | Buffer.concat 32 items | 1.0030 us/op | 1.0630 us/op | 0.94 | | Uint8Array.set 32 items | 1.4090 us/op | 1.7670 us/op | 0.80 | | Buffer.copy | 1.6700 us/op | 2.1580 us/op | 0.77 | | Uint8Array.set - with subarray | 2.7610 us/op | 3.6500 us/op | 0.76 | | Uint8Array.set - without subarray | 1.6090 us/op | 1.8400 us/op | 0.87 | | getUint32 - dataview | 280.00 ns/op | 322.00 ns/op | 0.87 | | getUint32 - manual | 239.00 ns/op | 279.00 ns/op | 0.86 | | Set add up to 64 items then delete first | 2.4070 us/op | 3.0391 us/op | 0.79 | | OrderedSet add up to 64 items then delete first | 3.6215 us/op | 4.6066 us/op | 0.79 | | Set add up to 64 items then delete last | 2.7216 us/op | 3.2731 us/op | 0.83 | | OrderedSet add up to 64 items then delete last | 4.3266 us/op | 5.2249 us/op | 0.83 | | Set add up to 64 items then delete middle | 2.9004 us/op | 3.3645 us/op | 0.86 | | OrderedSet add up to 64 items then delete middle | 5.8776 us/op | 7.0069 us/op | 0.84 | | Set add up to 128 items then delete first | 5.8584 us/op | 7.2213 us/op | 0.81 | | OrderedSet add up to 128 items then delete first | 8.2572 us/op | 12.323 us/op | 0.67 | | Set add up to 128 items then delete last | 5.7398 us/op | 7.2096 us/op | 0.80 | | OrderedSet add up to 128 items then delete last | 8.9361 us/op | 10.607 us/op | 0.84 | | Set add up to 128 items then delete middle | 5.9924 us/op | 6.5897 us/op | 0.91 | | OrderedSet add up to 128 items then delete middle | 15.305 us/op | 17.277 us/op | 0.89 | | Set add up to 256 items then delete first | 11.576 us/op | 12.972 us/op | 0.89 | | OrderedSet add up to 256 items then delete first | 17.710 us/op | 19.595 us/op | 0.90 | | Set add up to 256 items then delete last | 12.340 us/op | 11.484 us/op | 1.07 | | OrderedSet add up to 256 items then delete last | 18.216 us/op | 17.774 us/op | 1.02 | | Set add up to 256 items then delete middle | 11.782 us/op | 12.202 us/op | 0.97 | | OrderedSet add up to 256 items then delete middle | 47.983 us/op | 50.190 us/op | 0.96 | | transfer serialized Status (84 B) | 1.4360 us/op | 1.4280 us/op | 1.01 | | copy serialized Status (84 B) | 1.2430 us/op | 1.2920 us/op | 0.96 | | transfer serialized SignedVoluntaryExit (112 B) | 1.4810 us/op | 1.5410 us/op | 0.96 | | copy serialized SignedVoluntaryExit (112 B) | 1.3090 us/op | 1.3460 us/op | 0.97 | | transfer serialized ProposerSlashing (416 B) | 1.6730 us/op | 1.7710 us/op | 0.94 | | copy serialized ProposerSlashing (416 B) | 1.6580 us/op | 1.8660 us/op | 0.89 | | transfer serialized Attestation (485 B) | 1.8350 us/op | 1.8200 us/op | 1.01 | | copy serialized Attestation (485 B) | 1.9960 us/op | 1.8430 us/op | 1.08 | | transfer serialized AttesterSlashing (33232 B) | 1.8240 us/op | 1.8310 us/op | 1.00 | | copy serialized AttesterSlashing (33232 B) | 5.8380 us/op | 6.3230 us/op | 0.92 | | transfer serialized Small SignedBeaconBlock (128000 B) | 2.8070 us/op | 2.5660 us/op | 1.09 | | copy serialized Small SignedBeaconBlock (128000 B) | 17.540 us/op | 20.631 us/op | 0.85 | | transfer serialized Avg SignedBeaconBlock (200000 B) | 4.0270 us/op | 2.9840 us/op | 1.35 | | copy serialized Avg SignedBeaconBlock (200000 B) | 33.652 us/op | 33.559 us/op | 1.00 | | transfer serialized BlobsSidecar (524380 B) | 4.5850 us/op | 3.3430 us/op | 1.37 | | copy serialized BlobsSidecar (524380 B) | 196.30 us/op | 90.240 us/op | 2.18 | | transfer serialized Big SignedBeaconBlock (1000000 B) | 8.2980 us/op | 3.3380 us/op | 2.49 | | copy serialized Big SignedBeaconBlock (1000000 B) | 314.84 us/op | 174.70 us/op | 1.80 | | pass gossip attestations to forkchoice per slot | 3.2327 ms/op | 3.0905 ms/op | 1.05 | | forkChoice updateHead vc 100000 bc 64 eq 0 | 556.82 us/op | 618.07 us/op | 0.90 | | forkChoice updateHead vc 600000 bc 64 eq 0 | 4.6271 ms/op | 3.8137 ms/op | 1.21 | | forkChoice updateHead vc 1000000 bc 64 eq 0 | 6.1754 ms/op | 5.8579 ms/op | 1.05 | | forkChoice updateHead vc 600000 bc 320 eq 0 | 4.0183 ms/op | 3.6566 ms/op | 1.10 | | forkChoice updateHead vc 600000 bc 1200 eq 0 | 4.0106 ms/op | 3.6498 ms/op | 1.10 | | forkChoice updateHead vc 600000 bc 7200 eq 0 | 4.4407 ms/op | 5.3050 ms/op | 0.84 | | forkChoice updateHead vc 600000 bc 64 eq 1000 | 11.461 ms/op | 12.482 ms/op | 0.92 | | forkChoice updateHead vc 600000 bc 64 eq 10000 | 11.641 ms/op | 12.271 ms/op | 0.95 | | forkChoice updateHead vc 600000 bc 64 eq 300000 | 18.051 ms/op | 23.995 ms/op | 0.75 | | computeDeltas 500000 validators 300 proto nodes | 3.9887 ms/op | 4.2318 ms/op | 0.94 | | computeDeltas 500000 validators 1200 proto nodes | 4.1949 ms/op | 4.4475 ms/op | 0.94 | | computeDeltas 500000 validators 7200 proto nodes | 4.5053 ms/op | 4.6504 ms/op | 0.97 | | computeDeltas 750000 validators 300 proto nodes | 6.4630 ms/op | 7.7081 ms/op | 0.84 | | computeDeltas 750000 validators 1200 proto nodes | 6.3341 ms/op | 7.3604 ms/op | 0.86 | | computeDeltas 750000 validators 7200 proto nodes | 6.7963 ms/op | 7.4995 ms/op | 0.91 | | computeDeltas 1400000 validators 300 proto nodes | 12.707 ms/op | 12.589 ms/op | 1.01 | | computeDeltas 1400000 validators 1200 proto nodes | 11.916 ms/op | 12.562 ms/op | 0.95 | | computeDeltas 1400000 validators 7200 proto nodes | 12.077 ms/op | 12.818 ms/op | 0.94 | | computeDeltas 2100000 validators 300 proto nodes | 18.930 ms/op | 19.283 ms/op | 0.98 | | computeDeltas 2100000 validators 1200 proto nodes | 18.081 ms/op | 18.749 ms/op | 0.96 | | computeDeltas 2100000 validators 7200 proto nodes | 17.478 ms/op | 17.583 ms/op | 0.99 | | altair processAttestation - 250000 vs - 7PWei normalcase | 2.5820 ms/op | 1.8844 ms/op | 1.37 | | altair processAttestation - 250000 vs - 7PWei worstcase | 3.4223 ms/op | 3.0727 ms/op | 1.11 | | altair processAttestation - setStatus - 1/6 committees join | 148.67 us/op | 101.70 us/op | 1.46 | | altair processAttestation - setStatus - 1/3 committees join | 233.17 us/op | 235.00 us/op | 0.99 | | altair processAttestation - setStatus - 1/2 committees join | 305.08 us/op | 352.44 us/op | 0.87 | | altair processAttestation - setStatus - 2/3 committees join | 401.54 us/op | 450.49 us/op | 0.89 | | altair processAttestation - setStatus - 4/5 committees join | 619.35 us/op | 656.32 us/op | 0.94 | | altair processAttestation - setStatus - 100% committees join | 736.83 us/op | 854.94 us/op | 0.86 | | altair processBlock - 250000 vs - 7PWei normalcase | 8.5185 ms/op | 6.6742 ms/op | 1.28 | | altair processBlock - 250000 vs - 7PWei normalcase hashState | 30.712 ms/op | 35.947 ms/op | 0.85 | | altair processBlock - 250000 vs - 7PWei worstcase | 41.549 ms/op | 47.348 ms/op | 0.88 | | altair processBlock - 250000 vs - 7PWei worstcase hashState | 80.961 ms/op | 108.19 ms/op | 0.75 | | phase0 processBlock - 250000 vs - 7PWei normalcase | 3.3391 ms/op | 3.4151 ms/op | 0.98 | | phase0 processBlock - 250000 vs - 7PWei worstcase | 30.582 ms/op | 36.032 ms/op | 0.85 | | altair processEth1Data - 250000 vs - 7PWei normalcase | 533.14 us/op | 678.75 us/op | 0.79 | | getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 | 7.0280 us/op | 10.451 us/op | 0.67 | | getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 | 48.938 us/op | 50.228 us/op | 0.97 | | getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 | 11.143 us/op | 17.566 us/op | 0.63 | | getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 | 8.5260 us/op | 11.774 us/op | 0.72 | | getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 | 182.31 us/op | 183.43 us/op | 0.99 | | getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 | 1.3747 ms/op | 1.7031 ms/op | 0.81 | | getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 | 1.7253 ms/op | 2.6780 ms/op | 0.64 | | getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 | 1.6894 ms/op | 2.6434 ms/op | 0.64 | | getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 | 4.8531 ms/op | 8.4853 ms/op | 0.57 | | getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 | 2.0610 ms/op | 2.3037 ms/op | 0.89 | | getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 | 4.7654 ms/op | 6.1309 ms/op | 0.78 | | Tree 40 250000 create | 354.22 ms/op | 544.34 ms/op | 0.65 | | Tree 40 250000 get(125000) | 163.13 ns/op | 249.06 ns/op | 0.66 | | Tree 40 250000 set(125000) | 930.60 ns/op | 1.4101 us/op | 0.66 | | Tree 40 250000 toArray() | 23.376 ms/op | 26.994 ms/op | 0.87 | | Tree 40 250000 iterate all - toArray() + loop | 23.756 ms/op | 26.904 ms/op | 0.88 | | Tree 40 250000 iterate all - get(i) | 66.073 ms/op | 79.074 ms/op | 0.84 | | Array 250000 create | 4.3336 ms/op | 4.7643 ms/op | 0.91 | | Array 250000 clone - spread | 3.5650 ms/op | 4.1554 ms/op | 0.86 | | Array 250000 get(125000) | 0.49800 ns/op | 0.55000 ns/op | 0.91 | | Array 250000 set(125000) | 0.55300 ns/op | 0.62900 ns/op | 0.88 | | Array 250000 iterate all - loop | 129.70 us/op | 167.14 us/op | 0.78 | | phase0 afterProcessEpoch - 250000 vs - 7PWei | 123.52 ms/op | 133.02 ms/op | 0.93 | | Array.fill - length 1000000 | 4.3964 ms/op | 8.9296 ms/op | 0.49 | | Array push - length 1000000 | 24.353 ms/op | 63.623 ms/op | 0.38 | | Array.get | 0.32157 ns/op | 0.39023 ns/op | 0.82 | | Uint8Array.get | 0.49951 ns/op | 0.63510 ns/op | 0.79 | | phase0 beforeProcessEpoch - 250000 vs - 7PWei | 27.145 ms/op | 34.205 ms/op | 0.79 | | altair processEpoch - mainnet_e81889 | 424.12 ms/op | 536.93 ms/op | 0.79 | | mainnet_e81889 - altair beforeProcessEpoch | 22.612 ms/op | 38.521 ms/op | 0.59 | | mainnet_e81889 - altair processJustificationAndFinalization | 24.162 us/op | 33.230 us/op | 0.73 | | mainnet_e81889 - altair processInactivityUpdates | 8.7461 ms/op | 11.125 ms/op | 0.79 | | mainnet_e81889 - altair processRewardsAndPenalties | 63.435 ms/op | 62.127 ms/op | 1.02 | | mainnet_e81889 - altair processRegistryUpdates | 5.6910 us/op | 5.0650 us/op | 1.12 | | mainnet_e81889 - altair processSlashings | 881.00 ns/op | 1.1460 us/op | 0.77 | | mainnet_e81889 - altair processEth1DataReset | 605.00 ns/op | 931.00 ns/op | 0.65 | | mainnet_e81889 - altair processEffectiveBalanceUpdates | 2.7343 ms/op | 3.0305 ms/op | 0.90 | | mainnet_e81889 - altair processSlashingsReset | 4.9510 us/op | 8.6610 us/op | 0.57 | | mainnet_e81889 - altair processRandaoMixesReset | 7.0300 us/op | 11.607 us/op | 0.61 | | mainnet_e81889 - altair processHistoricalRootsUpdate | 989.00 ns/op | 1.7460 us/op | 0.57 | | mainnet_e81889 - altair processParticipationFlagUpdates | 4.8440 us/op | 7.5050 us/op | 0.65 | | mainnet_e81889 - altair processSyncCommitteeUpdates | 859.00 ns/op | 1.5010 us/op | 0.57 | | mainnet_e81889 - altair afterProcessEpoch | 117.44 ms/op | 155.45 ms/op | 0.76 | | capella processEpoch - mainnet_e217614 | 1.4324 s/op | 2.2566 s/op | 0.63 | | mainnet_e217614 - capella beforeProcessEpoch | 91.767 ms/op | 103.24 ms/op | 0.89 | | mainnet_e217614 - capella processJustificationAndFinalization | 23.529 us/op | 39.977 us/op | 0.59 | | mainnet_e217614 - capella processInactivityUpdates | 23.115 ms/op | 28.251 ms/op | 0.82 | | mainnet_e217614 - capella processRewardsAndPenalties | 282.59 ms/op | 319.79 ms/op | 0.88 | | mainnet_e217614 - capella processRegistryUpdates | 20.971 us/op | 20.583 us/op | 1.02 | | mainnet_e217614 - capella processSlashings | 899.00 ns/op | 1.5940 us/op | 0.56 | | mainnet_e217614 - capella processEth1DataReset | 737.00 ns/op | 1.0800 us/op | 0.68 | | mainnet_e217614 - capella processEffectiveBalanceUpdates | 18.807 ms/op | 20.929 ms/op | 0.90 | | mainnet_e217614 - capella processSlashingsReset | 6.9080 us/op | 7.6460 us/op | 0.90 | | mainnet_e217614 - capella processRandaoMixesReset | 7.6700 us/op | 14.611 us/op | 0.52 | | mainnet_e217614 - capella processHistoricalRootsUpdate | 723.00 ns/op | 2.7440 us/op | 0.26 | | mainnet_e217614 - capella processParticipationFlagUpdates | 3.0330 us/op | 7.8320 us/op | 0.39 | | mainnet_e217614 - capella afterProcessEpoch | 271.87 ms/op | 356.34 ms/op | 0.76 | | phase0 processEpoch - mainnet_e58758 | 450.62 ms/op | 535.50 ms/op | 0.84 | | mainnet_e58758 - phase0 beforeProcessEpoch | 103.99 ms/op | 121.37 ms/op | 0.86 | | mainnet_e58758 - phase0 processJustificationAndFinalization | 25.217 us/op | 36.523 us/op | 0.69 | | mainnet_e58758 - phase0 processRewardsAndPenalties | 35.647 ms/op | 42.942 ms/op | 0.83 | | mainnet_e58758 - phase0 processRegistryUpdates | 10.394 us/op | 15.604 us/op | 0.67 | | mainnet_e58758 - phase0 processSlashings | 536.00 ns/op | 925.00 ns/op | 0.58 | | mainnet_e58758 - phase0 processEth1DataReset | 435.00 ns/op | 1.0690 us/op | 0.41 | | mainnet_e58758 - phase0 processEffectiveBalanceUpdates | 1.7869 ms/op | 2.0448 ms/op | 0.87 | | mainnet_e58758 - phase0 processSlashingsReset | 3.8370 us/op | 13.080 us/op | 0.29 | | mainnet_e58758 - phase0 processRandaoMixesReset | 7.0950 us/op | 17.792 us/op | 0.40 | | mainnet_e58758 - phase0 processHistoricalRootsUpdate | 990.00 ns/op | 1.5560 us/op | 0.64 | | mainnet_e58758 - phase0 processParticipationRecordUpdates | 4.5810 us/op | 8.0000 us/op | 0.57 | | mainnet_e58758 - phase0 afterProcessEpoch | 91.824 ms/op | 122.09 ms/op | 0.75 | | phase0 processEffectiveBalanceUpdates - 250000 normalcase | 1.7326 ms/op | 2.3308 ms/op | 0.74 | | phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 | 3.7030 ms/op | 3.5034 ms/op | 1.06 | | altair processInactivityUpdates - 250000 normalcase | 23.251 ms/op | 28.109 ms/op | 0.83 | | altair processInactivityUpdates - 250000 worstcase | 18.905 ms/op | 26.714 ms/op | 0.71 | | phase0 processRegistryUpdates - 250000 normalcase | 9.1260 us/op | 18.825 us/op | 0.48 | | phase0 processRegistryUpdates - 250000 badcase_full_deposits | 352.69 us/op | 431.15 us/op | 0.82 | | phase0 processRegistryUpdates - 250000 worstcase 0.5 | 135.62 ms/op | 186.56 ms/op | 0.73 | | altair processRewardsAndPenalties - 250000 normalcase | 46.588 ms/op | 56.661 ms/op | 0.82 | | altair processRewardsAndPenalties - 250000 worstcase | 47.401 ms/op | 57.215 ms/op | 0.83 | | phase0 getAttestationDeltas - 250000 normalcase | 10.348 ms/op | 12.956 ms/op | 0.80 | | phase0 getAttestationDeltas - 250000 worstcase | 8.2730 ms/op | 9.6158 ms/op | 0.86 | | phase0 processSlashings - 250000 worstcase | 105.47 us/op | 127.36 us/op | 0.83 | | altair processSyncCommitteeUpdates - 250000 | 159.70 ms/op | 185.89 ms/op | 0.86 | | BeaconState.hashTreeRoot - No change | 356.00 ns/op | 423.00 ns/op | 0.84 | | BeaconState.hashTreeRoot - 1 full validator | 156.91 us/op | 140.12 us/op | 1.12 | | BeaconState.hashTreeRoot - 32 full validator | 1.5026 ms/op | 1.5895 ms/op | 0.95 | | BeaconState.hashTreeRoot - 512 full validator | 14.629 ms/op | 18.574 ms/op | 0.79 | | BeaconState.hashTreeRoot - 1 validator.effectiveBalance | 173.09 us/op | 287.75 us/op | 0.60 | | BeaconState.hashTreeRoot - 32 validator.effectiveBalance | 2.3258 ms/op | 3.1773 ms/op | 0.73 | | BeaconState.hashTreeRoot - 512 validator.effectiveBalance | 33.100 ms/op | 37.254 ms/op | 0.89 | | BeaconState.hashTreeRoot - 1 balances | 94.013 us/op | 155.09 us/op | 0.61 | | BeaconState.hashTreeRoot - 32 balances | 930.41 us/op | 1.5585 ms/op | 0.60 | | BeaconState.hashTreeRoot - 512 balances | 11.240 ms/op | 13.291 ms/op | 0.85 | | BeaconState.hashTreeRoot - 250000 balances | 229.65 ms/op | 331.16 ms/op | 0.69 | | aggregationBits - 2048 els - zipIndexesInBitList | 28.169 us/op | 47.475 us/op | 0.59 | | byteArrayEquals 32 | 59.478 ns/op | 75.946 ns/op | 0.78 | | Buffer.compare 32 | 19.364 ns/op | 24.263 ns/op | 0.80 | | byteArrayEquals 1024 | 1.8139 us/op | 2.4135 us/op | 0.75 | | Buffer.compare 1024 | 28.518 ns/op | 31.331 ns/op | 0.91 | | byteArrayEquals 16384 | 28.643 us/op | 35.043 us/op | 0.82 | | Buffer.compare 16384 | 221.06 ns/op | 262.56 ns/op | 0.84 | | byteArrayEquals 123687377 | 215.19 ms/op | 260.59 ms/op | 0.83 | | Buffer.compare 123687377 | 12.453 ms/op | 14.292 ms/op | 0.87 | | byteArrayEquals 32 - diff last byte | 64.737 ns/op | 78.835 ns/op | 0.82 | | Buffer.compare 32 - diff last byte | 20.059 ns/op | 29.238 ns/op | 0.69 | | byteArrayEquals 1024 - diff last byte | 1.8348 us/op | 2.3001 us/op | 0.80 | | Buffer.compare 1024 - diff last byte | 31.972 ns/op | 42.527 ns/op | 0.75 | | byteArrayEquals 16384 - diff last byte | 30.744 us/op | 33.951 us/op | 0.91 | | Buffer.compare 16384 - diff last byte | 264.17 ns/op | 332.30 ns/op | 0.79 | | byteArrayEquals 123687377 - diff last byte | 233.21 ms/op | 261.19 ms/op | 0.89 | | Buffer.compare 123687377 - diff last byte | 12.744 ms/op | 10.329 ms/op | 1.23 | | byteArrayEquals 32 - random bytes | 6.7760 ns/op | 7.6630 ns/op | 0.88 | | Buffer.compare 32 - random bytes | 21.850 ns/op | 22.203 ns/op | 0.98 | | byteArrayEquals 1024 - random bytes | 6.0190 ns/op | 6.1140 ns/op | 0.98 | | Buffer.compare 1024 - random bytes | 20.532 ns/op | 21.113 ns/op | 0.97 | | byteArrayEquals 16384 - random bytes | 6.0280 ns/op | 7.0970 ns/op | 0.85 | | Buffer.compare 16384 - random bytes | 21.088 ns/op | 21.497 ns/op | 0.98 | | byteArrayEquals 123687377 - random bytes | 7.5700 ns/op | 8.4000 ns/op | 0.90 | | Buffer.compare 123687377 - random bytes | 21.640 ns/op | 24.180 ns/op | 0.89 | | regular array get 100000 times | 48.473 us/op | 59.113 us/op | 0.82 | | wrappedArray get 100000 times | 36.757 us/op | 44.780 us/op | 0.82 | | arrayWithProxy get 100000 times | 14.578 ms/op | 15.978 ms/op | 0.91 | | ssz.Root.equals | 48.468 ns/op | 54.089 ns/op | 0.90 | | byteArrayEquals | 47.567 ns/op | 54.947 ns/op | 0.87 | | Buffer.compare | 11.562 ns/op | 12.978 ns/op | 0.89 | | shuffle list - 16384 els | 7.1059 ms/op | 8.0369 ms/op | 0.88 | | shuffle list - 250000 els | 108.68 ms/op | 121.33 ms/op | 0.90 | | processSlot - 1 slots | 19.451 us/op | 17.062 us/op | 1.14 | | processSlot - 32 slots | 3.6351 ms/op | 3.5118 ms/op | 1.04 | | getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei | 43.482 ms/op | 43.407 ms/op | 1.00 | | getCommitteeAssignments - req 1 vs - 250000 vc | 2.2610 ms/op | 2.6905 ms/op | 0.84 | | getCommitteeAssignments - req 100 vs - 250000 vc | 4.3638 ms/op | 5.3951 ms/op | 0.81 | | getCommitteeAssignments - req 1000 vs - 250000 vc | 4.7759 ms/op | 5.6410 ms/op | 0.85 | | findModifiedValidators - 10000 modified validators | 360.08 ms/op | 417.68 ms/op | 0.86 | | findModifiedValidators - 1000 modified validators | 209.59 ms/op | 277.09 ms/op | 0.76 | | findModifiedValidators - 100 modified validators | 177.00 ms/op | 306.05 ms/op | 0.58 | | findModifiedValidators - 10 modified validators | 196.30 ms/op | 243.98 ms/op | 0.80 | | findModifiedValidators - 1 modified validators | 158.25 ms/op | 249.30 ms/op | 0.63 | | findModifiedValidators - no difference | 153.17 ms/op | 232.73 ms/op | 0.66 | | compare ViewDUs | 3.2994 s/op | 4.2862 s/op | 0.77 | | compare each validator Uint8Array | 1.6438 s/op | 1.6307 s/op | 1.01 | | compare ViewDU to Uint8Array | 1.0924 s/op | 1.6861 s/op | 0.65 | | migrate state 1000000 validators, 24 modified, 0 new | 951.88 ms/op | 1.2479 s/op | 0.76 | | migrate state 1000000 validators, 1700 modified, 1000 new | 1.2224 s/op | 1.7961 s/op | 0.68 | | migrate state 1000000 validators, 3400 modified, 2000 new | 1.4864 s/op | 1.7993 s/op | 0.83 | | migrate state 1500000 validators, 24 modified, 0 new | 1.1415 s/op | 1.1705 s/op | 0.98 | | migrate state 1500000 validators, 1700 modified, 1000 new | 1.4525 s/op | 1.4496 s/op | 1.00 | | migrate state 1500000 validators, 3400 modified, 2000 new | 1.4599 s/op | 1.6513 s/op | 0.88 | | RootCache.getBlockRootAtSlot - 250000 vs - 7PWei | 5.0500 ns/op | 5.9200 ns/op | 0.85 | | state getBlockRootAtSlot - 250000 vs - 7PWei | 483.61 ns/op | 676.79 ns/op | 0.71 | | computeProposers - vc 250000 | 7.4694 ms/op | 9.1278 ms/op | 0.82 | | computeEpochShuffling - vc 250000 | 101.80 ms/op | 117.77 ms/op | 0.86 | | getNextSyncCommittee - vc 250000 | 126.57 ms/op | 153.29 ms/op | 0.83 | | computeSigningRoot for AttestationData | 18.323 us/op | 25.422 us/op | 0.72 | | hash AttestationData serialized data then Buffer.toString(base64) | 1.6656 us/op | 1.9145 us/op | 0.87 | | toHexString serialized data | 946.03 ns/op | 1.1226 us/op | 0.84 | | Buffer.toString(base64) | 193.41 ns/op | 236.84 ns/op | 0.82 | | nodejs block root to RootHex using toHex | 180.90 ns/op | 206.29 ns/op | 0.88 | | nodejs block root to RootHex using toRootHex | 101.53 ns/op | 115.95 ns/op | 0.88 | | browser block root to RootHex using the deprecated toHexString | 246.54 ns/op | 306.16 ns/op | 0.81 | | browser block root to RootHex using toHex | 183.79 ns/op | 238.16 ns/op | 0.77 | | browser block root to RootHex using toRootHex | 172.76 ns/op | 189.35 ns/op | 0.91 |

by benchmarkbot/action

wemeetagain commented 1 month ago

What is the feature parity with our existing linter rules?

nflaig commented 1 month ago

What is the feature parity with our existing linter rules?

How can we determine that, I guess we would have to break every single eslint rule and see if the new rules catch the issue as well?

Do people run yarn lint locally or just rely on the extension to show errors pretty much instantly? I don't find myself running a full lint from CLI a lot

nazarhussain commented 1 month ago

What is the feature parity with our existing linter rules?

For that we need to rely on community and our own testing. There is biome migrate which is designed to handle eslint and prettier migration. Most of rules migration was done automatically. Rest I went over each eslint rule one by one manually to match corresponding in biomejs.

A few of biome recommended rules are turned off to match to our styling e.g. noForEach. And my plan is to turned these on one by one specially in suspicious and correctness category.

You can also check https://biomejs.dev/linter/rules-sources/

nazarhussain commented 1 month ago

Do people run yarn lint locally or just rely on the extension to show errors pretty much instantly? I don't find myself running a full lint from CLI a lot

Not sure about others, I heavily rely on the IDE feedback and while 3-4 projects open in the VSCode at the time, I often have to restart the Eslint server in our project, specially when inter-package dependencies are changed.

image

When I am about to finish some changes, I run full lint as well which is faster than waiting for the CI.

nflaig commented 1 month ago

I often have to restart the Eslint server in our project, specially when inter-package dependencies are changed.

yeah this one is annoying, this mostly happens if I change branches

nazarhussain commented 1 month ago

Here is the full rules comparison.

Rule/Settings Biome Note
globals.BigInt javascript/globals/BigInt
ignorePatterns vcs.useIgnoreFile Also overrides.include to turn off some rules for specific files not in Git
@chainsafe/ndoe
file-extension-in-import lint/correctness/useImportExtensions
no-deprecated-api Diagnostics | Biome
@typescript-eslint
await-thenable
ban-ts-comment
ban-types lint/complexity/noBannedTypes
explicit-function-return-type
explicit-member-accessibility lint/nursery/useConsistentMemberAccessibility
func-call-spacing
naming-convention lint/style/useNamingConvention
no-array-constructor lint/correctness/useArrayLiterals
no-duplicate-enum-values
no-explicit-any lint/suspicious/noExplicitAny
no-extra-non-null-assertion lint/suspicious/noExtraNonNullAssertion
no-floating-promises
no-loss-of-precision lint/correctness/noPrecisionLoss
no-misused-new lint/suspicious/noMisleadingInstantiator
no-namespace lint/style/noNamespace
no-non-null-asserted-optional-chain
no-non-null-assertion lint/style/noNonNullAssertion
no-require-imports lint/nursery/noCommonJs
no-this-alias lint/complexity/noUselessThisAlias
no-unnecessary-type-assertion
no-unnecessary-type-constraint lint/complexity/noUselessTypeConstraint
no-unsafe-assignment
no-unsafe-call
no-unsafe-declaration-merging lint/suspicious/noUnsafeDeclarationMerging
no-unsafe-member-access
no-unsafe-return
no-unused-expressions
no-unused-vars lint/correctness/noUnusedVariables
no-var-requires
prefer-as-const lint/style/useAsConstAssertion
restrict-template-expressions
return-await
semi
strict-boolean-expressions
triple-slash-reference
type-annotation-spacing
eslint-plugin-import
no-extraneous-dependencies lint/correctness/noUndeclaredDependencies !! Not working...
no-relative-packages
order Imports Sorting | Biome Not identical but very similar to eslint plugin.
eslint-plugin-vitest
vitest/consistent-test-it
vitest/no-focused-tests lint/suspicious/noFocusedTests
vitest/prefer-called-with
vitest/prefer-spy-on
expect-expect
no-identical-title
no-commented-out-tests
valid-title
valid-expect
valid-describe-callback
require-local-test-context-for-concurrent-snapshots
no-import-node-test
eslint
for-direction lint/correctness/useValidForDirection
func-names
getter-return lint/suspicious/useGetterReturn
new-parens
no-async-promise-executor lint/suspicious/noAsyncPromiseExecutor
no-caller
no-case-declarations lint/correctness/noSwitchDeclarations
no-class-assign lint/suspicious/noClassAssign
no-compare-neg-zero lint/suspicious/noCompareNegZero
no-cond-assign lint/suspicious/noAssignInExpressions
no-console lint/suspicious/noConsoleLog
no-const-assign lint/suspicious/noAssignInExpressions
no-constant-condition lint/correctness/noConstantCondition
no-control-regex lint/suspicious/noControlCharactersInRegex
no-debugger lint/suspicious/noDebugger
no-delete-var
no-dupe-args lint/suspicious/noDuplicateParameters
no-dupe-class-members lint/suspicious/noDuplicateClassMembers
no-dupe-else-if lint/nursery/noDuplicateElseIf
no-dupe-keys lint/suspicious/noDuplicateObjectKeys
no-duplicate-case lint/suspicious/noDuplicateCase
no-empty lint/suspicious/noEmptyBlockStatements
no-empty-character-class lint/correctness/noEmptyCharacterClassInRegex
no-empty-pattern lint/correctness/noEmptyPattern
no-ex-assign lint/suspicious/noCatchAssign
no-extra-boolean-cast lint/complexity/noExtraBooleanCast
no-extra-semi Not needed as builtin formatter take care of it.
no-fallthrough lint/suspicious/noFallthroughSwitchClause
no-func-assign lint/suspicious/noFunctionAssign
no-global-assign lint/suspicious/noGlobalAssign
no-import-assign lint/suspicious/noImportAssign
no-inner-declarations lint/correctness/noInnerDeclarations
no-invalid-regexp
no-irregular-whitespace lint/nursery/noIrregularWhitespace
no-loss-of-precision lint/correctness/noPrecisionLoss
no-misleading-character-class lint/suspicious/noMisleadingCharacterClass
no-mixed-spaces-and-tabs
no-new-symbol lint/correctness/noInvalidBuiltinInstantiation
no-nonoctal-decimal-escape lint/correctness/noNonoctalDecimalEscape
no-obj-calls lint/correctness/noGlobalObjectCalls
no-octal lint/nursery/noOctalEscape
no-redeclare lint/suspicious/noRedeclare
no-regex-spaces lint/complexity/noMultipleSpacesInRegularExpressionLiterals
no-restricted-globals lint/style/noRestrictedGlobals
no-restricted-imports lint/nursery/noRestrictedImports
no-restricted-syntax
no-self-assign lint/correctness/noSelfAssign

no-setter-return lint/correctness/noSetterReturn
no-shadow-restricted-names lint/suspicious/noShadowRestrictedNames
no-sparse-arrays lint/suspicious/noSparseArray
no-this-before-super lint/correctness/noUnreachableSuper
no-undef lint/correctness/noUndeclaredVariables
no-unexpected-multiline
no-unreachable lint/correctness/noUnreachable
no-unsafe-finally lint/correctness/noUnsafeFinally
no-unsafe-negation lint/suspicious/noUnsafeNegation
no-unsafe-optional-chaining lint/correctness/noUnsafeOptionalChaining
no-unused-labels lint/correctness/noUnusedLabels
no-useless-backreference
no-useless-catch lint/complexity/noUselessCatch
no-useless-escape lint/nursery/noUselessEscapeInRegex
no-var lint/style/noVar
no-with lint/complexity/noWith
object-curly-spacing
prefer-const lint/style/useConst
quotes javascript.formatter.quoteStyle
require-yield lint/correctness/useYield
use-isnan lint/correctness/useIsNan
valid-typeof lint/suspicious/useValidTypeof
prettier
prettier formatter.enabled Differences with Prettier | Biome
nflaig commented 1 month ago

Here is the full rules comparison.

This list seems incomplete, what about no-restricted-imports, no-restricted-syntax, no-restricted-globals? (likely more missing)

And how easy is it to have custom rules with biomejs like we have here https://github.com/ChainSafe/lodestar/blob/c4952eef7ee2e362e08a313c128e22e394bc44e0/.eslintrc.js#L140-L146 and here https://github.com/ChainSafe/lodestar/blob/c4952eef7ee2e362e08a313c128e22e394bc44e0/.eslintrc.js#L266-L275

nazarhussain commented 1 month ago

This list seems incomplete, what about no-restricted-imports, no-restricted-syntax, no-restricted-globals? (likely more missing)

Some rows were missed during copying from the markdown notes to github. Updated the list now.

nazarhussain commented 1 month ago

And how easy is it to have custom rules with biomejs like we have here

Currently we can't! But that's a topic to be covered soon. Biome plugin support #2463. The proposal for that is up here RFC: Biome Plugins Proposal #1762.

What community is doing right now is to have biomejs as standard and eslint only for custom rules to get both performance and customization.

Keeping that list in focus, I don't think we need any custom rules at the moment or near future. There are tons of beneficial rules which are enabled with recommended settings under the hood already.

nazarhussain commented 1 month ago

@wemeetagain Created a PR myself for Biome to have that feature soon. https://github.com/biomejs/biome/pull/4233

nazarhussain commented 1 month ago

@wemeetagain I had been investigating and found some weird behavior from eslint. e.g. We have that rule to enforce return type for functions.

https://github.com/ChainSafe/lodestar/blob/068fbae928989295706443887c645d476bb95695/.eslintrc.js#L35

But found a lot of occurrences in the code which is not been linted properly for that rule. For a lot of these cases I don't consider are expressions, so the definition of expression is not clear from the eslint perspective.

https://github.com/ChainSafe/lodestar/blob/068fbae928989295706443887c645d476bb95695/packages/api/src/utils/urlFormat.ts#L85 https://github.com/ChainSafe/lodestar/blob/068fbae928989295706443887c645d476bb95695/packages/beacon-node/src/api/impl/beacon/index.ts#L25 https://github.com/ChainSafe/lodestar/blob/068fbae928989295706443887c645d476bb95695/packages/beacon-node/src/api/impl/beacon/rewards/index.ts#L15 https://github.com/ChainSafe/lodestar/blob/068fbae928989295706443887c645d476bb95695/packages/cli/test/utils/crucible/assertions/defaults/attestationParticipationAssertion.ts#L27

nflaig commented 1 month ago

But found a lot of occurrences in the code which is not been linted properly for that rule.

those are all functions that are returned inside another function which has the return type declared

nazarhussain commented 1 month ago

those are all functions that are returned inside another function which has the return type declared

That's what I explained above I don't consider a lot of these cases as expressions so allowExpresions options seems wage to me.

nflaig commented 1 month ago

allowExpresions options seems wage to me.

I am not sure this rule is even evaluated for those, have you tried if you set allowExpresions to false? I would expect that there is still no error because return type is inferred from top-level return or interface

nazarhussain commented 1 month ago

I am not sure this rule is even evaluated for those, have you tried if you set allowExpresions to false? I would expect that there is still no error because return type is inferred from top-level return or interface

Yes it's evaluated and consider all parameters of a function or an attribute of an object as an expression. So if any function is passed as arguments or any function passed to object attributes it skip error for these. I am not aligned with their definition of the expression in these cases.

wemeetagain commented 1 week ago

:tada: This PR is included in v1.23.0 :tada: