From 7da69511da5d55e12089878bbb0ab1ef28a4fd19 Mon Sep 17 00:00:00 2001 From: Gilles Lepretre Date: Tue, 19 May 2026 22:11:50 +0200 Subject: [PATCH 1/2] Use NPM variable instead of hardcoded yarn --- base.Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base.Makefile b/base.Makefile index 3a5d95f..e98e22b 100644 --- a/base.Makefile +++ b/base.Makefile @@ -231,7 +231,7 @@ endif install-nod%: ## install-node: Install node dependencies for development $(LOG) - yarn install --production=false --check-files + $(NPM) install --production=false --check-files rm -fr .eslintcache requirements/%.txt: requirements/%.in ## requirements/%.txt: Generate python requirements From aeb606ed847acb1bc5dcfef30f8955a5065d59d0 Mon Sep 17 00:00:00 2001 From: Gilles Lepretre Date: Tue, 19 May 2026 22:11:46 +0200 Subject: [PATCH 2/2] Make prettier binary configurable Replaceable by compatible formatter such as oxfmt --- base.Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/base.Makefile b/base.Makefile index e98e22b..2508f76 100644 --- a/base.Makefile +++ b/base.Makefile @@ -66,6 +66,7 @@ NPM ?= $(shell command -v yarn 2> /dev/null) NODE_BINDIR ?= $(shell $(NPM) bin) ### Commands (from `NODE_BINDIR` via `PATH` environment variable) JEST ?= jest +PRETTIER ?= prettier # Set PATH to node binaries export PATH := $(NODE_BINDIR):$(PATH) endif @@ -165,7 +166,7 @@ ifneq ($(STAGED_JINJA_FILES),) @$(DJLINT) $(STAGED_JINJA_FILES) --lint endif ifneq (,$(STAGED_NODE_FILES)) - @prettier --write $(STAGED_NODE_FILES) + @$(PRETTIER) --write $(STAGED_NODE_FILES) endif @FORMATTED_FILES=`git diff --name-only $(STAGED_PYTHON_FILES) $(STAGED_JINJA_FILES) $(STAGED_NODE_FILES)`; if [[ "$$FORMATTED_FILES" ]]; then \ echo; \ @@ -184,7 +185,11 @@ endif # DOT_FILES ?= MakeCitron.Makefile .sass-lint.yml PYTHON_DOT_FILES ?= pyproject.toml setup.cfg -NODE_DOT_FILES ?= .eslintrc.json .eslintignore .prettierrc .prettierignore jsconfig.json +PRETTIER_DOT_FILES := +ifeq ($(PRETTIER),prettier) +PRETTIER_DOT_FILES := .prettierrc .prettierignore +endif +NODE_DOT_FILES ?= .eslintrc.json .eslintignore $(PRETTIER_DOT_FILES) jsconfig.json ifdef _NODE DOT_FILES += $(NODE_DOT_FILES) endif @@ -357,7 +362,7 @@ fix-pytho%: ## fix-python: Fix python source format and lint violations fix-nod%: ## fix-node: Fix node source format $(LOG) - prettier --write '{,lib/**/}*.js?(x)' + $(PRETTIER) --write '{,lib/**/}*.js?(x)' fi%: least-specific-fix ## fix: Fix all source format $(LOG)