try using 'pve-eslint' if it exists

but fallback to 'eslint' otherwise

introduce the defines.mk for this

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2023-06-22 10:23:05 +02:00
parent 02b57c1cda
commit c3209035f1
3 changed files with 7 additions and 3 deletions

1
defines.mk Normal file
View File

@ -0,0 +1 @@
ESLINT ?= $(if $(shell command -v pve-eslint), pve-eslint, eslint)

View File

@ -1,3 +1,5 @@
include ../defines.mk
JSSRC= \
Utils.js \
FilterProxy.js \
@ -106,7 +108,7 @@ OnlineHelpInfo.js: /usr/bin/asciidoc-pmg
mv $@.tmp $@
.lint-incremental: $(JSSRC)
eslint $?
$(ESLINT) $?
touch "$@"
.PHONY: lint
@ -114,7 +116,7 @@ lint: .lint-incremental
.PHONY: check
check: $(JSSRC)
eslint --strict $(JSSRC)
$(ESLINT) --strict $(JSSRC)
touch ".lint-incremental"
pmgmanagerlib.js: OnlineHelpInfo.js $(JSSRC)

View File

@ -1,3 +1,4 @@
include ../../defines.mk
# caution: order is important
MOBILESRC= \
@ -10,7 +11,7 @@ MOBILESRC= \
app.js \
lint: pmgmanagerlib-mobile.js
eslint $^
$(ESLINT) $^
.PHONY: check
check: lint