]> git.proxmox.com Git - pve-manager.git/commitdiff
try using 'pve-eslint' if it exists
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 23 Jun 2023 07:08:44 +0000 (09:08 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 24 Jun 2023 15:43:02 +0000 (17:43 +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>
www/manager6/Makefile

index 2d884f4a4aef3255a76e95b76b47bc9ca5dc4f02..5b455c80922d61466fa2b26dd6c3011e02182adb 100644 (file)
@@ -1,5 +1,7 @@
 include ../../defines.mk
 
+ESLINT ?= $(if $(shell command -v pve-eslint), pve-eslint, eslint)
+
 JSSRC=                                                         \
        Parser.js                                       \
        StateProvider.js                                \
@@ -314,13 +316,13 @@ WIDGETKIT=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
 all:
 
 .lint-incremental: $(JSSRC)
-       eslint $?
+       $(ESLINT) $?
        touch "$@"
 
 .PHONY: lint
 check: lint
 lint: $(JSSRC)
-       eslint --strict $(JSSRC)
+       $(ESLINT) --strict $(JSSRC)
        touch ".lint-incremental"
 
 pvemanagerlib.js: .lint-incremental OnlineHelpInfo.js $(JSSRC)