try using 'pve-eslint' if it exists

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>
This commit is contained in:
Dominik Csapak 2023-06-23 09:08:44 +02:00 committed by Thomas Lamprecht
parent 6d727f81c8
commit 45c2099cbd

View File

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