[gnome-shell-extensions/wip/fmuellner/lint-ci: 10/18] lint: Add "legacy" configuration
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions/wip/fmuellner/lint-ci: 10/18] lint: Add "legacy" configuration
- Date: Mon, 28 Jan 2019 05:53:08 +0000 (UTC)
commit 190243ee895a708e253278f5f2623bf90c7cbc9d
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Jan 28 01:45:10 2019 +0100
lint: Add "legacy" configuration
Regarding coding style, gjs is moving in a direction that departs quite
significantly from the established style, in particular when indenting
multi-line array/object literals or method arguments:
Currently we are keeping those elements aligned, while the gjs rules now
expect them to use the regular 4-space indentation.
There are certainly good arguments that can be made for that move - it's
much less prone to leading to overly-long lines, and matches popluar JS
styles elsewhere. But switching coding style implies large diffs which
interfere with git-blame and friends, so in order to allow for a more
gradual change, add a separate set of "legacy" rules that match more
closely the style we would expect up to now.
It also disables the rules for quotes and template strings - the former
because we cannot match the current style to use double-quotes for
translatable strings and single-quotes otherwise, the latter because
template strings are still relatively new, so we haven't adopted them
yet.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50
lint/eslintrc-legacy.json | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/lint/eslintrc-legacy.json b/lint/eslintrc-legacy.json
new file mode 100644
index 0000000..0bbbff1
--- /dev/null
+++ b/lint/eslintrc-legacy.json
@@ -0,0 +1,20 @@
+{
+ "rules": {
+ "indent": [
+ "error",
+ 4,
+ {
+ "ignoredNodes": [
+ "ConditionalExpression",
+ "CallExpression > ArrowFunctionExpression",
+ "CallExpression[callee.object.name=GObject][callee.property.name=registerClass] >
ClassExpression:first-child"
+ ],
+ "CallExpression": { "arguments": "first" },
+ "ArrayExpression": "first",
+ "ObjectExpression": "first",
+ "MemberExpression": "off"
+ }
+ ],
+ "quotes": "off"
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]