The 'improved code' after linting was unnecessarily complex introducing a named variable across multiple lines for no reason which made it look better to keep using then. A bit surprising.
Previous catch example was code which didn't differentiate between failing case (which is now a deliberate null) and undefined case (which is often the result of an error).
Also the previous catch example was the only example for a rule which is called 'no-then' and therefore the failing example didn't use 'then' either.
The 'improved code' after linting was unnecessarily complex introducing a named variable across multiple lines for no reason which made it look better to keep using
then
. A bit surprising.Previous catch example was code which didn't differentiate between failing case (which is now a deliberate null) and undefined case (which is often the result of an error).
Also the previous catch example was the only example for a rule which is called 'no-then' and therefore the failing example didn't use 'then' either.