thehubbleproject / hubble-contracts

Hubble optimistic rollup
https://thehubbleproject.github.io/docs/
MIT License
132 stars 28 forks source link

Add eslint with mocha rules #554

Open jacque006 opened 3 years ago

jacque006 commented 3 years ago

What's Wrong

Per https://github.com/thehubbleproject/hubble-contracts/pull/552#discussion_r616244448 , there are a number of gotcha's such as describe/it.onlys being committed unknowingly. There are likely other code issues we could scan for as well.

How to fix it

jacque006 commented 3 years ago

Consider: Add check to ensure all equality checks are strict equality. See https://stackoverflow.com/questions/359494/which-equals-operator-vs-should-be-used-in-javascript-comparisons/359509#359509 for a good opinion on why strict equality is preferable.

tl;dr use ===, !==, enforce via linting