The app that I work on is having an issue with using non-memoized versions of reference types such as arrays, objects, and functions (see Object & array dependencies in the React useEffect Hook). At the moment I am going through all of our code and manually fixing the issues, however this is not an ideal long-term solution for preventing developers from making the same mistake in the future.
I am investigating ways to prevent this from happening in the future to optimize performance and would like to find a lint rule to enforce that this isn't done by anyone in the future. However, I'm not seeing one.
Does anyone have any suggestions on good ways to enforce that this error isn't made other than just communicating it effectively with the entire development team and helping to make sure that everyone is aware to watch for this during code reviews?