Comment by bastawhiz

Comment by bastawhiz 2 days ago

0 replies

> Yes there is? Though this is usually better served with a type checker, it’s still totally feasible with a linter too if that’s your bag

It's not, because you would have to implement a full static analyzer that traces where the result of a `findOne` call is checked for `null` and then check that the condition always leads to a `NotFoundError`. At best you've got a linter that only works some of the time, at worst you've just made your linter terribly slow and buggy.

> these tools still ignore that line sometimes so I still have to check for it myself.

this is _literally_ the point of the article