diff --git a/Makefile b/Makefile index 31cb7a6a9ab..a9067af70df 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,10 @@ misspell-correction: $(MISSPELL) .PHONY: markdown-link-check markdown-link-check: - @for f in $(ALL_DOCS); do npx markdown-link-check --quiet --config .markdown_link_check_config.json $$f; done + @for f in $(ALL_DOCS); do \ + npx --no -- markdown-link-check --quiet --config .markdown_link_check_config.json $$f \ + || exit 1; \ + done # This target runs markdown-toc on all files that contain # a comment . @@ -38,7 +41,7 @@ markdown-toc: @for f in $(ALL_DOCS); do \ if grep -q '' $$f; then \ echo markdown-toc: processing $$f; \ - npx markdown-toc --no-first-h1 -i $$f; \ + npx --no -- markdown-toc --no-first-h1 -i $$f || exit 1; \ else \ echo markdown-toc: no TOC markers, skipping $$f; \ fi; \ @@ -46,8 +49,11 @@ markdown-toc: .PHONY: markdownlint markdownlint: - @if ! npm ls markdownlint; then npm install; fi - @for f in $(ALL_DOCS); do echo $$f; npx markdownlint -c .markdownlint.yaml $$f || exit 1; done + @for f in $(ALL_DOCS); do \ + echo $$f; \ + npx --no -p markdownlint-cli markdownlint -c .markdownlint.yaml $$f \ + || exit 1; \ + done .PHONY: install-yamllint install-yamllint: diff --git a/package.json b/package.json index 94e1ead289a..3de99a6a9fd 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,6 @@ "devDependencies": { "markdown-link-check": "^3.9.3", "markdown-toc": "^1.2.0", - "markdownlint-cli": "0.31.0" + "markdownlint-cli": "^0.31.0" } }