From 77b7c985f600415d2d1d9518d777d73055bdf6aa Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 19 Oct 2020 12:44:48 +0200 Subject: [PATCH] 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 Reviewed-By: Michael Dawson --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ecdd3c58aa1922..43441f2d0bee75 100644 --- a/Makefile +++ b/Makefile @@ -1211,13 +1211,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 @@ -1225,9 +1225,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 \