wikimedia / eslint-config-wikimedia

JavaScript style guide for Wikimedia.
https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript
MIT License
29 stars 20 forks source link

common: Remove allowSingleLine exception from brace-style #512

Closed edg2s closed 1 year ago

edg2s commented 1 year ago

This allowed single line functions, but only if there were no other statements on the line (e.g. 'return' or 'var') due to max-statements-per-line. This meant it wasn't clear when single line functions were allowed.

Also, single line functions are better implemented as arrow functions in ES6.

It also allowed single line else blocks, which is arguably against our style guide.

Add an exception for vue where single line code is widely used in attribute values.

Fixes #511