summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2020-10-19 12:44:48 +0200
committerAntoine du Hamel <duhamelantoine1995@gmail.com>2020-10-30 12:01:46 +0100
commit0c6143656ce992accd8bedbf20c0ea25d3679a67 (patch)
tree0345d4a816ef92242732a0a55a1eefe4f63bcefb
parente8fe38f7cff7c10296defef88ad661c144124534 (diff)
downloadnode-new-0c6143656ce992accd8bedbf20c0ea25d3679a67.tar.gz
build,tools: add lint-js-doc target
Add a build target to lint JS code in Markdown files only. PR-URL: https://github.com/nodejs/node/pull/35708 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
-rw-r--r--Makefile9
1 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 08386412bf..4f397c82f6 100644
--- a/Makefile
+++ b/Makefile
@@ -1194,13 +1194,13 @@ tools/.mdlintstamp: $(LINT_MD_FILES)
.PHONY: lint-md
# Lints the markdown documents maintained by us in the codebase.
-lint-md: | tools/.mdlintstamp
+lint-md: lint-js-doc | tools/.mdlintstamp
LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools
run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \
- --report-unused-disable-directives --ext=.js,.mjs,.md $(LINT_JS_TARGETS)
+ --report-unused-disable-directives --ext=$(EXTENSIONS) $(LINT_JS_TARGETS)
run-lint-js-fix = $(run-lint-js) --fix
.PHONY: lint-js-fix
@@ -1208,9 +1208,12 @@ lint-js-fix:
@$(call available-node,$(run-lint-js-fix))
.PHONY: lint-js
+.PHONY: lint-js-doc
# Note that on the CI `lint-js-ci` is run instead.
# Lints the JavaScript code with eslint.
-lint-js:
+lint-js: EXTENSIONS=.js,.mjs,.md
+lint-js-doc: EXTENSIONS=.md
+lint-js lint-js-doc:
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping $@ (no crypto)"; \
else \