lint: Sync configuration with gjs

gjs updated its eslint configuration, so sync our copy.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1498
This commit is contained in:
Florian Müllner 2020-11-13 23:52:58 +01:00 committed by Georges Basile Stavracas Neto
parent 8a47f1c667
commit 3567820a87

View File

@ -1,4 +1,5 @@
--- ---
# SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
env: env:
es6: true es6: true
extends: 'eslint:recommended' extends: 'eslint:recommended'
@ -24,7 +25,9 @@ rules:
# allow: [^vfunc_, ^on_, _instance_init] # allow: [^vfunc_, ^on_, _instance_init]
comma-dangle: comma-dangle:
- error - error
- always-multiline - arrays: always-multiline
objects: always-multiline
functions: never
comma-spacing: comma-spacing:
- error - error
- before: false - before: false
@ -106,15 +109,15 @@ rules:
no-prototype-builtins: 'off' no-prototype-builtins: 'off'
no-restricted-properties: no-restricted-properties:
- error - error
- object: Lang
property: copyProperties
message: Use Object.assign()
- object: Lang - object: Lang
property: bind property: bind
message: Use arrow notation or Function.prototype.bind() message: Use arrow notation or Function.prototype.bind()
- object: Lang - object: Lang
property: Class property: Class
message: Use ES6 classes message: Use ES6 classes
- object: imports
property: mainloop
message: Use GLib main loops and timeouts
no-restricted-syntax: no-restricted-syntax:
- error - error
- selector: >- - selector: >-
@ -130,6 +133,8 @@ rules:
BlockStatement[body.length=1] BlockStatement[body.length=1]
CallExpression[arguments.length=0][callee.object.type="Super"][callee.property.name="_init"] CallExpression[arguments.length=0][callee.object.type="Super"][callee.property.name="_init"]
message: _init() that only calls super._init() is unnecessary 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-assign: error
no-return-await: error no-return-await: error
no-self-compare: error no-self-compare: error
@ -166,6 +171,9 @@ rules:
object-shorthand: error object-shorthand: error
operator-assignment: error operator-assignment: error
operator-linebreak: error operator-linebreak: error
padded-blocks:
- error
- never
# These may be a bit controversial, we can try them out and enable them later # These may be a bit controversial, we can try them out and enable them later
# prefer-const: error # prefer-const: error
# prefer-destructuring: error # prefer-destructuring: error
@ -226,4 +234,4 @@ globals:
print: readonly print: readonly
printerr: readonly printerr: readonly
parserOptions: parserOptions:
ecmaVersion: 2019 ecmaVersion: 2020