Skip to content

Release v2.0.0

Compare
Choose a tag to compare
@Gelio Gelio released this 12 Mar 21:02
· 26 commits to master since this release
3cd97c7

This release adds support for detecting rule violations whenever hooks are used after a possible early-return.

Changelog

  • Report violations whenever a React hook is used after an early return.

    For example, the following code sample now violates the rule:

    function MyComponent({ counter }) {
      if (counter > 5) {
        return <div>Counter is over 5</div>;
      }
    
      useEffect(() => {
        console.log('Counter is', counter);
      });
    
      return <div>{counter}</div>;
    }