Skip to content

Commit 273e147

Browse files
aduh95targos
authored andcommitted
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 abd7c94 commit 273e147

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
@@ -1194,23 +1194,26 @@ tools/.mdlintstamp: $(LINT_MD_FILES)
11941194

11951195
.PHONY: lint-md
11961196
# Lints the markdown documents maintained by us in the codebase.
1197-
lint-md: | tools/.mdlintstamp
1197+
lint-md: lint-js-doc | tools/.mdlintstamp
11981198

11991199

12001200
LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools
12011201

12021202
run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \
1203-
--report-unused-disable-directives --ext=.js,.mjs,.md $(LINT_JS_TARGETS)
1203+
--report-unused-disable-directives --ext=$(EXTENSIONS) $(LINT_JS_TARGETS)
12041204
run-lint-js-fix = $(run-lint-js) --fix
12051205

12061206
.PHONY: lint-js-fix
12071207
lint-js-fix:
12081208
@$(call available-node,$(run-lint-js-fix))
12091209

12101210
.PHONY: lint-js
1211+
.PHONY: lint-js-doc
12111212
# Note that on the CI `lint-js-ci` is run instead.
12121213
# Lints the JavaScript code with eslint.
1213-
lint-js:
1214+
lint-js: EXTENSIONS=.js,.mjs,.md
1215+
lint-js-doc: EXTENSIONS=.md
1216+
lint-js lint-js-doc:
12141217
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
12151218
echo "Skipping $@ (no crypto)"; \
12161219
else \

0 commit comments

Comments
 (0)