diff --git a/.github/check-js.sh b/.github/check-js.sh new file mode 100755 index 0000000000..891c5182ac --- /dev/null +++ b/.github/check-js.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# This file is part of the phpBB Forum Software package. +# +# @copyright (c) phpBB Limited +# @license GNU General Public License, version 2 (GPL-2.0) +# +# For full copyright and license information, please see +# the docs/CREDITS.txt file. +# +set -e +set +x + +sudo npm install -g > /dev/null +npm ci > /dev/null +set -x +node_modules/xo/cli.js "phpBB/adm/style/*.js" +node_modules/xo/cli.js "phpBB/assets/javascript/*.js" +node_modules/xo/cli.js "phpBB/style/all/js/*.js" +node_modules/xo/cli.js "phpBB/style/prosilver/template/*.js" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fa6f2957ad..de5c8dbdb4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -84,6 +84,10 @@ jobs: run: | .github/check-stylesheet.sh + - name: Lint JavaScript files + run: | + .github/check-js.sh + - name: Check commit message if: github.event_name == 'pull_request' run: |