Was refactoring some code and naturally linter triggered and show invalid name. This happened while assigning variable (const a = b), however it never linted on return (return b)! What's going on here? Is it more complicated, error prone or noisy to lint on return? Or is it just too lazy in general? If b isn't declared anywhere, I'd like a heads up regardless of where it is referenced.
Can you post an example function please.
Something like this:
const a = b;
return [a, b];
This triggers red line under b on line 1. Nothing on return line. I thought perhaps the nr lint tab trigger would include return, but if I change a = b to a = 2, nr lint disappears. Replacing first b with 2 also removes my suspicion that it was lazy and only triggered on first reference.
That is indeed odd. It seems not to do the checking in the return statement. This shows errors on b as expected

