]> git.proxmox.com Git - pmg-gui.git/commitdiff
try using 'pve-eslint' if it exists
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 22 Jun 2023 08:23:05 +0000 (10:23 +0200)
committerDominik Csapak <d.csapak@proxmox.com>
Tue, 18 Jul 2023 11:08:45 +0000 (13:08 +0200)
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>
defines.mk [new file with mode: 0644]
js/Makefile
js/mobile/Makefile

diff --git a/defines.mk b/defines.mk
new file mode 100644 (file)
index 0000000..15d118f
--- /dev/null
@@ -0,0 +1 @@
+ESLINT ?= $(if $(shell command -v pve-eslint), pve-eslint, eslint)
index 082d94c330adc32cef94220adaacaa7a61227914..78f2b575cb558160667dcd2b870c642d88025a58 100644 (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)
index f07dfef6fec0856bf7c032030e5a109d63daaacd..f3856f3160897bdb6ce932f66094f40f2942807b 100644 (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