News for hackers. Stuff that matters.
Re:Why Do React Hooks Rely on Call Order? by politician on Friday December 14, 2018 @01:41PM (#18683325)
You might be able to use ES6 annotations to mark use* functions such that a bespoke Babel plugin can assert that the the control flow AST only contains functions so annotated in non-branching positions.

Basically, lint, but at transpile time.

Re:Why Do React Hooks Rely on Call Order? by WorldMaker on Friday December 14, 2018 @07:18PM (#18686117)
Similarly, tslint operates best as a Typescript plugin and so lint rules in Typescript still can happen at transpile time and aren't necessarily that much different in practice from compiler errors. Still bugs me a little that there's not a higher-kinded type or pattern that I can come up with to do it "for real" in the compilation.