[gnome-shell-extensions/wip/fmuellner/lint-ci: 7/18] lint: Allow single-line braces
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions/wip/fmuellner/lint-ci: 7/18] lint: Allow single-line braces
- Date: Mon, 28 Jan 2019 05:52:53 +0000 (UTC)
commit c704f0de553c87e433001f880d2a3a917e93e6a9
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Jan 28 01:42:00 2019 +0100
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 c02c6ca..cce7a32 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",
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]