From fc856caab8831e9c5ab74e56f1a028cd28af59f1 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 24 Nov 2017 10:50:19 +0800 Subject: [PATCH] build: add make lint-js-fix --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 2b832d0144670b..bbd2b3ba19f831 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 \