Skip to content

Commit 77b7c98

Browse files
aduh95BethGriggs
authored andcommittedDec 15, 2020
build,tools: add lint-js-doc target
Add a build target to lint JS code in Markdown files only. PR-URL: #35708 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent 8131d95 commit 77b7c98

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎Makefile

+6-3
Original file line numberDiff line numberDiff line change
@@ -1211,23 +1211,26 @@ tools/.mdlintstamp: $(LINT_MD_FILES)
12111211

12121212
.PHONY: lint-md
12131213
# Lints the markdown documents maintained by us in the codebase.
1214-
lint-md: | tools/.mdlintstamp
1214+
lint-md: lint-js-doc | tools/.mdlintstamp
12151215

12161216

12171217
LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools
12181218

12191219
run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \
1220-
--report-unused-disable-directives --ext=.js,.mjs,.md $(LINT_JS_TARGETS)
1220+
--report-unused-disable-directives --ext=$(EXTENSIONS) $(LINT_JS_TARGETS)
12211221
run-lint-js-fix = $(run-lint-js) --fix
12221222

12231223
.PHONY: lint-js-fix
12241224
lint-js-fix:
12251225
@$(call available-node,$(run-lint-js-fix))
12261226

12271227
.PHONY: lint-js
1228+
.PHONY: lint-js-doc
12281229
# Note that on the CI `lint-js-ci` is run instead.
12291230
# Lints the JavaScript code with eslint.
1230-
lint-js:
1231+
lint-js: EXTENSIONS=.js,.mjs,.md
1232+
lint-js-doc: EXTENSIONS=.md
1233+
lint-js lint-js-doc:
12311234
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
12321235
echo "Skipping $@ (no crypto)"; \
12331236
else \

0 commit comments

Comments
 (0)
Please sign in to comment.