diff --git a/Makefile b/Makefile index 746b88486bff7a..d1f3f661835d5f 100644 --- a/Makefile +++ b/Makefile @@ -1031,6 +1031,13 @@ LINT_JS_CMD = tools/eslint/bin/eslint.js --cache \ --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md \ $(LINT_JS_TARGETS) +lint-js-fix: + @if [ -x $(NODE) ]; then \ + $(NODE) $(LINT_JS_CMD) --fix; \ + else \ + node $(LINT_JS_CMD) --fix; \ + fi + lint-js: @echo "Running JS linter..." @if [ -x $(NODE) ]; then \ @@ -1177,6 +1184,7 @@ lint-clean: lint-cpp \ lint-js \ lint-js-ci \ + lint-js-fix \ list-gtests \ lint-md \ lint-md-build \