I just found out this was a bug that was fixed nine days ago. Check it out, and update your eslint!
The output from the two functions is not the same, but don’t take my word for it.
I modified the script slightly to print to this code block instead of the console
eslint might lead you to believe that the two functions above are identical, but they clearly are not.
Obviously the above is very contrived, but this actually bit me while using expressjs. I had a situation where I accidentally called
next() more than once in some cases which resulted in erratic and difficult to track down errors.
This probably could be solved with better coding practices, but I think it’s worth realizing that
no-else-return can introduce unexpected errors.