summaryrefslogtreecommitdiff
path: root/lint
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2020-11-13 23:52:58 +0100
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-11-16 18:04:23 +0000
commit3567820a874e9fe66ddef2da688a970b61ebc829 (patch)
treeb2ab11f8dda296ce8882bdf307a303eefa11215d /lint
parent8a47f1c66720516a1229ce1361b05d5b4b5475c8 (diff)
downloadgnome-shell-3567820a874e9fe66ddef2da688a970b61ebc829.tar.gz
lint: Sync configuration with gjs
gjs updated its eslint configuration, so sync our copy. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1498
Diffstat (limited to 'lint')
-rw-r--r--lint/eslintrc-gjs.yml18
1 files changed, 13 insertions, 5 deletions
diff --git a/lint/eslintrc-gjs.yml b/lint/eslintrc-gjs.yml
index 3fa6b86b5..13114fa7e 100644
--- a/lint/eslintrc-gjs.yml
+++ b/lint/eslintrc-gjs.yml
@@ -1,4 +1,5 @@
---
+# SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
env:
es6: true
extends: 'eslint:recommended'
@@ -24,7 +25,9 @@ rules:
# allow: [^vfunc_, ^on_, _instance_init]
comma-dangle:
- error
- - always-multiline
+ - arrays: always-multiline
+ objects: always-multiline
+ functions: never
comma-spacing:
- error
- before: false
@@ -107,14 +110,14 @@ rules:
no-restricted-properties:
- error
- object: Lang
+ property: copyProperties
+ message: Use Object.assign()
+ - object: Lang
property: bind
message: Use arrow notation or Function.prototype.bind()
- object: Lang
property: Class
message: Use ES6 classes
- - object: imports
- property: mainloop
- message: Use GLib main loops and timeouts
no-restricted-syntax:
- error
- selector: >-
@@ -130,6 +133,8 @@ rules:
BlockStatement[body.length=1]
CallExpression[arguments.length=0][callee.object.type="Super"][callee.property.name="_init"]
message: _init() that only calls super._init() is unnecessary
+ - selector: BinaryExpression[operator="instanceof"][right.name="Array"]
+ message: Use Array.isArray()
no-return-assign: error
no-return-await: error
no-self-compare: error
@@ -166,6 +171,9 @@ rules:
object-shorthand: error
operator-assignment: error
operator-linebreak: error
+ padded-blocks:
+ - error
+ - never
# These may be a bit controversial, we can try them out and enable them later
# prefer-const: error
# prefer-destructuring: error
@@ -226,4 +234,4 @@ globals:
print: readonly
printerr: readonly
parserOptions:
- ecmaVersion: 2019
+ ecmaVersion: 2020