tools: Add run-eslint.sh script

The script is a small wrapper around the `ci-run-eslint` package
from World/javascript, which is a generalized and improved version
of the .gitlab-ci/run-eslint script from gnome-shell.

It only requires `npm` to be available, so it simplifies running
eslint locally quite a lot

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/408>
This commit is contained in:
Florian Müllner
2025-06-10 03:55:44 +02:00
committed by Marge Bot
parent c03a76bb77
commit f1e0058e67
6 changed files with 38 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
# SPDX-FileCopyrightText: No rights reserved
# SPDX-License-Identifier: CC0-1.0
package-lock.json -diff
+2
View File
@@ -9,4 +9,6 @@ zip-files/
*.patch
*.sw?
.buildconfig
.eslintcache
.vscode
node_modules
+10
View File
@@ -29,3 +29,13 @@ SPDX-License-Identifier = "GPL-2.0-or-later"
path = ["po/LINGUAS", "po/POTFILES.in"]
SPDX-FileCopyrightText = "No rights reserved"
SPDX-License-Identifier = "CC0-1.0"
[[annotations]]
path = "tools/package.json"
SPDX-FileCopyrightText = "2025 Florian Müllner <fmuellner@gnome.org>"
SPDX-License-Identifier = "MIT OR LGPL-2.0-or-later"
[[annotations]]
path = "**package-lock.json"
SPDX-FileCopyrightText = "No rights reserved"
SPDX-License-Identifier = "CC0-1.0"
BIN
View File
Binary file not shown.
+14
View File
@@ -0,0 +1,14 @@
{
"name": "gnome-shell-extensions-dev-scripts",
"version": "1.0.0",
"license": "MIT OR LGPL-2.0-or-later",
"type": "module",
"private": true,
"scripts": {
"lint": "cd .. && ci-run-eslint"
},
"dependencies": {
"ci-run-eslint": "git+https://gitlab.gnome.org/World/javascript/ci-run-eslint.git",
"eslint-plugin-jsdoc": "^48.11.0"
}
}
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
# SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
# SPDX-FileCopyrightText: 2020 Philip Chimento <philip.chimento@gmail.com>
# SPDX-FileCopyrightText: 2025 Florian Müllner <fmuellner@gnome.org>
cd $(dirname -- "$0")
[ ! -d node_modules ] && npm clean-install
npm run lint -- "$@"