From c704f0de553c87e433001f880d2a3a917e93e6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 01:42:00 +0100 Subject: [PATCH] lint: Allow single-line braces When using arrow functions, we only omit the braces when we are using the return value: this.get_children().filter(w => w.visible); When braces are used, eslint by default enforces line breaks, but there are cases where the expression is hardly less concise than the above: this.get_children().forEach(w => { w.destroy(); }); So change the default to allow this. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lint/eslintrc-shell.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json index c02c6cae..cce7a323 100644 --- a/lint/eslintrc-shell.json +++ b/lint/eslintrc-shell.json @@ -1,6 +1,13 @@ { "rules": { "arrow-spacing": "error", + "brace-style": [ + "error", + "1tbs", + { + "allowSingleLine": true + } + ], "camelcase": [ "error", {