]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
try using 'pve-eslint' if it exists
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 23 Jun 2023 07:08:45 +0000 (09:08 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 24 Jun 2023 15:47:18 +0000 (17:47 +0200)
but fallback to 'eslint' otherwise

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [T: move into www/manager Makefile directly]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/Makefile

index 7cff5dd68335bbdec729f22797822b986a52e3bc..baa90ecefd52fac9e953a6e2af1e9bf8f5e2e3c0 100644 (file)
@@ -1,5 +1,7 @@
 include defines.mk
 
+ESLINT ?= $(if $(shell command -v pve-eslint), pve-eslint, eslint)
+
 SUBDIRS= css images proxmox-dark
 
 # bundle it for now from the libjs-marked debian package to avoid touching our proxies file mapper,
@@ -110,14 +112,14 @@ all: $(SUBDIRS)
        set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done
 
 .lint-incremental: $(JSSRC)
-       eslint $?
+       $(ESLINT) $?
        touch "$@"
 
 .PHONY: lint
 check: lint
-       eslint --strict api-viewer/APIViewer.js
+       $(ESLINT) --strict api-viewer/APIViewer.js
 lint: $(JSSRC)
-       eslint --strict $(JSSRC)
+       $(ESLINT) --strict $(JSSRC)
        touch ".lint-incremental"
 
 BUILD_TIME=$(or $(SOURCE_DATE_EPOCH),$(shell date '+%s.%N'))