From 337d2b9972b27e3b3b9dc7008feeb4d8d42acf00 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/17283 Reviewed-By: Gibson Fahnestock Reviewed-By: Anatoli Papirovski Reviewed-By: Colin Ihrig Reviewed-By: Evan Lucas Reviewed-By: Michaƫl Zasso --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 97927fc5c80b6e..5a58b2c6ccf2b6 100644 --- a/Makefile +++ b/Makefile @@ -1036,6 +1036,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 \ @@ -1182,6 +1189,7 @@ lint-clean: lint-cpp \ lint-js \ lint-js-ci \ + lint-js-fix \ list-gtests \ lint-md \ lint-md-build \