4 ms·
Ah yes the “exhaustive dependencies” rule that can trigger huge unnecessary refactors for absolutely zero value. Linting has some value, it’s just that in my p
by davedx 3y ago
Ah yes the “exhaustive dependencies” rule that can trigger huge unnecessary refactors for absolutely zero value.
Linting has some value, it’s just that in my professional experience its costs outweigh its benefits
- padjo 3y agoIf you leave dependencies off a hook by mistake you’re creating bugs, unintended behaviour and making your code a nightmare to modify. That’s always going to be worth linting for. Can you over lint a codebase, sure I guess so, if your lint stage is taking hours it probably needs optimization, but your assertion that type checking is enough is incorrect.
- davedx 3y agoHaving to specify every single closure in dependencies does nothing. Not every dependency has to be specified. Not specifying a dependency is not always a bug. Honestly if not exhaustively putting some closures in your useEffect deps list is your idea of a “maintenance nightmare” then maybe you should stay away from real production code bases? There are plenty of hairier mistakes and patterns out there than that.