From 9ae6d55e0df8e903dc01934e5cb5513325572819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 25 Oct 2025 12:28:28 +0200 Subject: [PATCH] tools: Symlink node_modules in project root NPM assumes quite strongly that it manages the project as a whole and its package/lock files are located in the project root. While we somehow managed to keep the npm tooling in a subfolder, this comes at the cost of breaking imports of additional modules. This will become relevant when we update eslint to a supported version, as we want to keep using the `junit` formatter in CI, which has now been split out into a separate module. So bite the bullet and make the node_modules folder available in the project root. On the plus side, having the node_modules folder in the project root allows language servers in IDEs/editors to pick it up. Part-of: --- tools/run-eslint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/run-eslint.sh b/tools/run-eslint.sh index 45bd267d..6d2c72c4 100755 --- a/tools/run-eslint.sh +++ b/tools/run-eslint.sh @@ -3,6 +3,10 @@ # SPDX-FileCopyrightText: 2020 Philip Chimento # SPDX-FileCopyrightText: 2025 Florian Müllner -cd $(dirname -- "$0") +srcdir=$(dirname -- "$0") + +cd $srcdir [ ! -d node_modules ] && npm clean-install +# Link in project root to make imports work properly +[ ! -e ../node_modules ] && ln -s $srcdir/node_modules ../node_modules npm run lint -- "$@"