github / eslint-plugin-github

An opinionated collection of ESLint rules used by GitHub.
MIT License
286 stars 51 forks source link

Update no-then.md #503

Closed cefn closed 4 months ago

cefn commented 4 months ago

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.