[polari] lint: Synchronize configuration with gjs
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] lint: Synchronize configuration with gjs
- Date: Fri, 13 Aug 2021 02:56:22 +0000 (UTC)
commit 72c6bf39e3b91a2e72a34dc10a0005bac5a1ad5e
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Aug 12 17:17:16 2021 +0200
lint: Synchronize configuration with gjs
The most notable change is that gjs now requires
jsdoc comments. This looks like a good idea, but
for now leave out private helper functions.
https://gitlab.gnome.org/GNOME/polari/-/merge_requests/211
.gitlab-ci.yml | 4 ++--
lint/eslintrc-gjs.yml | 32 +++++++++++++++++++++++++++++---
lint/eslintrc-polari.yml | 3 +++
3 files changed, 34 insertions(+), 5 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index da81f8fe..16ed40a9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -82,10 +82,10 @@ check-merge-request:
junit: check-merge-request-report.xml
eslint:
- image: registry.gitlab.gnome.org/gnome/gnome-shell/fedora/33:2020-11-17.0
+ image: registry.gitlab.gnome.org/gnome/gnome-shell/fedora/34:2021-08-12.0
stage: review
script:
- - eslint -o $LINT_LOG -f junit src
+ - eslint -o $LINT_LOG -f junit --resolve-plugins-relative-to $(npm root -g) src
artifacts:
paths:
- ${LINT_LOG}
diff --git a/lint/eslintrc-gjs.yml b/lint/eslintrc-gjs.yml
index 13114fa7..dadf40bd 100644
--- a/lint/eslintrc-gjs.yml
+++ b/lint/eslintrc-gjs.yml
@@ -1,8 +1,12 @@
---
# SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
+# SPDX-FileCopyrightText: 2018 Claudio André <claudioandre br gmail com>
env:
es6: true
+ es2020: true
extends: 'eslint:recommended'
+plugins:
+ - jsdoc
rules:
array-bracket-newline:
- error
@@ -60,6 +64,17 @@ rules:
- 'CallExpression[callee.object.name=GObject][callee.property.name=registerClass] >
ClassExpression:first-child'
# Allow dedenting chained member expressions
MemberExpression: 'off'
+ jsdoc/check-alignment: error
+ jsdoc/check-param-names: error
+ jsdoc/check-tag-names: error
+ jsdoc/check-types: error
+ jsdoc/implements-on-classes: error
+ jsdoc/newline-after-description: error
+ jsdoc/require-jsdoc: error
+ jsdoc/require-param: error
+ jsdoc/require-param-description: error
+ jsdoc/require-param-name: error
+ jsdoc/require-param-type: error
key-spacing:
- error
- beforeColon: false
@@ -107,8 +122,15 @@ rules:
no-octal-escape: error
no-proto: error
no-prototype-builtins: 'off'
+ no-restricted-globals: [error, window]
no-restricted-properties:
- error
+ - object: imports
+ property: format
+ message: Use template strings
+ - object: pkg
+ property: initFormat
+ message: Use template strings
- object: Lang
property: copyProperties
message: Use Object.assign()
@@ -167,6 +189,7 @@ rules:
object-curly-newline:
- error
- consistent: true
+ multiline: true
object-curly-spacing: error
object-shorthand: error
operator-assignment: error
@@ -214,14 +237,14 @@ rules:
template-curly-spacing: error
template-tag-spacing: error
unicode-bom: error
- valid-jsdoc:
- - error
- - requireReturn: false
wrap-iife:
- error
- inside
yield-star-spacing: error
yoda: error
+settings:
+ jsdoc:
+ mode: typescript
globals:
ARGV: readonly
Debugger: readonly
@@ -233,5 +256,8 @@ globals:
logError: readonly
print: readonly
printerr: readonly
+ window: readonly
+ TextEncoder: readonly
+ TextDecoder: readonly
parserOptions:
ecmaVersion: 2020
diff --git a/lint/eslintrc-polari.yml b/lint/eslintrc-polari.yml
index 8698bf24..2c527f30 100644
--- a/lint/eslintrc-polari.yml
+++ b/lint/eslintrc-polari.yml
@@ -3,6 +3,9 @@ rules:
- error
- properties: never
allow: [^vfunc_, ^on_]
+ jsdoc/require-jsdoc:
+ - error
+ - publicOnly: true
object-curly-spacing:
- error
- always
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]