| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1045,37 +1045,29 @@ lint-md: | |||
| 1045 | 1045 | endif | |
| 1046 | 1046 | ||
| 1047 | 1047 | LINT_JS_TARGETS = benchmark doc lib test tools | |
| 1048 | - LINT_JS_CMD = tools/eslint/bin/eslint.js --cache \ | ||
| 1049 | - --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md \ | ||
| 1050 | - $(LINT_JS_TARGETS) | ||
| 1048 | + | ||
| 1049 | + run-lint-js = tools/eslint/bin/eslint.js --cache \ | ||
| 1050 | + --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md $(LINT_JS_TARGETS) | ||
| 1051 | + run-lint-js-fix = $(run-lint-js) --fix | ||
| 1051 | 1052 | ||
| 1052 | 1053 | lint-js-fix: | |
| 1053 | - @if [ -x $(NODE) ]; then \ | ||
| 1054 | - $(NODE) $(LINT_JS_CMD) --fix; \ | ||
| 1055 | - else \ | ||
| 1056 | - node $(LINT_JS_CMD) --fix; \ | ||
| 1057 | - fi | ||
| 1054 | + @$(call available-node,$(run-lint-js-fix)) | ||
| 1058 | 1055 | ||
| 1059 | 1056 | lint-js: | |
| 1060 | 1057 | @echo "Running JS linter..." | |
| 1061 | - @if [ -x $(NODE) ]; then \ | ||
| 1062 | - $(NODE) $(LINT_JS_CMD); \ | ||
| 1063 | - else \ | ||
| 1064 | - node $(LINT_JS_CMD); \ | ||
| 1065 | - fi | ||
| 1058 | + @$(call available-node,$(run-lint-js)) | ||
| 1066 | 1059 | ||
| 1067 | 1060 | jslint: lint-js | |
| 1068 | 1061 | @echo "Please use lint-js instead of jslint" | |
| 1069 | 1062 | ||
| 1063 | + run-lint-js-ci = tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \ | ||
| 1064 | + $(LINT_JS_TARGETS) | ||
| 1065 | + | ||
| 1066 | + .PHONY: lint-js-ci | ||
| 1067 | + # On the CI the output is emitted in the TAP format. | ||
| 1070 | 1068 | lint-js-ci: | |
| 1071 | 1069 | @echo "Running JS linter..." | |
| 1072 | - @if [ -x $(NODE) ]; then \ | ||
| 1073 | - $(NODE) tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \ | ||
| 1074 | - $(LINT_JS_TARGETS); \ | ||
| 1075 | - else \ | ||
| 1076 | - node tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \ | ||
| 1077 | - $(LINT_JS_TARGETS); \ | ||
| 1078 | - fi | ||
| 1070 | + @$(call available-node,$(run-lint-js-ci)) | ||
| 1079 | 1071 | ||
| 1080 | 1072 | jslint-ci: lint-js-ci | |
| 1081 | 1073 | @echo "Please use lint-js-ci instead of jslint-ci" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments