Skip to content

Commit 1fdcdce

Browse files
aduh95BethGriggs
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 <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent ed82a06 commit 1fdcdce

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,23 +1195,26 @@ tools/.mdlintstamp: $(LINT_MD_FILES)
11951195

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

12001200

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

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

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

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

0 commit comments

Comments
 (0)