summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-01-21 01:17:47 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-01-24 03:49:54 +0800
commit13bc53fb2644ec2fa79eded305f1c6306a521eaf (patch)
tree8c4d86b5bdfa58688273c21a75914b9e329ce23f /Makefile
parentbe0778b3610c111594380b78f7f69d574fc7e141 (diff)
downloadandroid-node-v8-13bc53fb2644ec2fa79eded305f1c6306a521eaf.tar.gz
android-node-v8-13bc53fb2644ec2fa79eded305f1c6306a521eaf.tar.bz2
android-node-v8-13bc53fb2644ec2fa79eded305f1c6306a521eaf.zip
build: make lint-js independent of local node
PR-URL: https://github.com/nodejs/node/pull/18272 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 10 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 9c162f67e5..33159d4af4 100644
--- a/Makefile
+++ b/Makefile
@@ -998,43 +998,33 @@ lint-md:
endif
LINT_JS_TARGETS = benchmark doc lib test tools
-LINT_JS_CMD = tools/node_modules/eslint/bin/eslint.js --cache \
- --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md \
- $(LINT_JS_TARGETS)
+
+run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \
+ --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md $(LINT_JS_TARGETS)
+run-lint-js-fix = $(run-lint-js) --fix
.PHONY: lint-js-fix
lint-js-fix:
- @if [ -x $(NODE) ]; then \
- $(NODE) $(LINT_JS_CMD) --fix; \
- else \
- node $(LINT_JS_CMD) --fix; \
- fi
+ @$(call available-node,$(run-lint-js-fix))
.PHONY: lint-js
# Note that on the CI `lint-js-ci` is run instead.
# Lints the JavaScript code with eslint.
lint-js:
@echo "Running JS linter..."
- @if [ -x $(NODE) ]; then \
- $(NODE) $(LINT_JS_CMD); \
- else \
- node $(LINT_JS_CMD); \
- fi
+ @$(call available-node,$(run-lint-js))
jslint: lint-js
@echo "Please use lint-js instead of jslint"
+run-lint-js-ci = tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
+ $(LINT_JS_TARGETS)
+
.PHONY: lint-js-ci
# On the CI the output is emitted in the TAP format.
lint-js-ci:
@echo "Running JS linter..."
- @if [ -x $(NODE) ]; then \
- $(NODE) tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
- $(LINT_JS_TARGETS); \
- else \
- node tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
- $(LINT_JS_TARGETS); \
- fi
+ @$(call available-node,$(run-lint-js-ci))
jslint-ci: lint-js-ci
@echo "Please use lint-js-ci instead of jslint-ci"