summaryrefslogtreecommitdiff
path: root/lint
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2022-07-10 02:49:53 +0200
committerMarge Bot <marge-bot@gnome.org>2022-07-18 21:54:22 +0000
commitfa6a712a3411560a486c35d58ed3ee7ffd5a4ba9 (patch)
tree15e1d09857aaf09998bdc5cc42d875837337797e /lint
parenta5f2dd7d8c0c26cf0c2590619d381356bb9869a5 (diff)
downloadgnome-shell-fa6a712a3411560a486c35d58ed3ee7ffd5a4ba9.tar.gz
lint: Transition to gjs' object spacing rule
When gjs overhauled its coding style, it opted for disallowing spaces around braces in object literals: `{foo: 42}`. We opted out of that particular rule in commit 09b8e8f, primarily because it would have been a very intrusive change with the old style of object literals: ```js let oldStyle = { foo: 42, bar: 23 }; ``` Alas, all multi-line object literals have been transitioned to the new style where braces go on separate lines, so they are no longer subject to the rule one way or the other. Nowadays the rule mostly affects destructuring, and there it is a bit odd to apply different spacing rules to arrays and objects: ```js const [foo, bar] = someArray; const { baz, quz } = someObject; ``` This is now the main divergence from the canonical gnome style, and the only one where we directly contradict it. It would be good to transition away from that, and as the rule now only affect destructuring and single-line object literals, we can do that on a case-by-case bases by moving the override to the legacy configuration. As desctructuring imports makes up a fair share of the affected code, and those will change when moving to ES6 modules, this seems like a good moment to start that transition. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2375>
Diffstat (limited to 'lint')
-rw-r--r--lint/eslintrc-legacy.yml3
-rw-r--r--lint/eslintrc-shell.yml3
2 files changed, 3 insertions, 3 deletions
diff --git a/lint/eslintrc-legacy.yml b/lint/eslintrc-legacy.yml
index 9e5e6dcef..e0d4fa2e7 100644
--- a/lint/eslintrc-legacy.yml
+++ b/lint/eslintrc-legacy.yml
@@ -18,4 +18,7 @@ rules:
jsdoc/require-param-description: off
jsdoc/require-param-name: off
jsdoc/require-param-type: off
+ object-curly-spacing:
+ - error
+ - always
quotes: off
diff --git a/lint/eslintrc-shell.yml b/lint/eslintrc-shell.yml
index e0356b1e4..f0e1901d1 100644
--- a/lint/eslintrc-shell.yml
+++ b/lint/eslintrc-shell.yml
@@ -12,9 +12,6 @@ rules:
- mode: minimum
beforeColon: false
afterColon: true
- object-curly-spacing:
- - error
- - always
prefer-arrow-callback: error
overrides: