DEFRA / water-abstraction-team

Guides, info and issue management for the Water Abstraction Team
Other
1 stars 0 forks source link

Remove block-body exception from coding convention #118

Closed Cruikshanks closed 4 months ago

Cruikshanks commented 4 months ago

https://github.com/DEFRA/water-abstraction-team/issues/115

We have been working on using ESLint to help highlight coding convention infractions instead of folks either having to remember them when submitting or reviewing PRs. In Ensure use of block body for arrow functions we managed to figure out how to have the tool highlight when someone has used concise over block-body format for an arrow function.

However, the rule cannot distinguish between when it was being used normally, or just to check if something is 'truthy'. That was the one exception we had and there is no point in keeping it documented here if the tool won't allow it. We also didn't think it was worth the effort to try and 'hack' ESLint or develop a custom rule just to support this. On balance, it goes against one of our guiding principles of consistency anyway.

So, this change removes the exceptions from our docs.