From b42c41ee7cd7c171feefce69c88984106b78b8d2 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Thu, 11 Sep 2025 18:08:03 +0200 Subject: [PATCH 1/2] chore: use `prettier --write --ignore-unknown` in `lint-staged` to avoid errors on unsupported files Prevents Prettier from failing when lint-staged passes unknown/binary files, making the pre-commit hook more robust. This is recommended when using asterisk: https://github.com/lint-staged/lint-staged#automatically-fix-code-style-with-prettier-for-any-format-prettier-supports --- CHANGELOG.md | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16d0a462ec..6e06bdbc18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Thanks to: @dathbe. - Avoid potential port conflicts by using port 3001 for translator unit tests - Improve test reliability and maintainability - [tests] add alert module tests for different welcome_message configurations (#3867) +- [lint-staged] use `prettier --write --ignore-unknown` in `lint-staged` to avoid errors on unsupported files ### Updated diff --git a/package.json b/package.json index 9d47abf0af..91f010e1ce 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "test:unit": "NODE_ENV=test jest --selectProjects unit" }, "lint-staged": { - "*": "prettier --write", + "*": "prettier --ignore-unknown --write", "*.js": "eslint --fix", "*.css": "stylelint --fix" }, From 2c51447f90bf32375c6efebf71c32a5158032173 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Thu, 11 Sep 2025 18:22:50 +0200 Subject: [PATCH 2/2] docs: add PR id --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e06bdbc18..eed2625cc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,7 @@ Thanks to: @dathbe. - Avoid potential port conflicts by using port 3001 for translator unit tests - Improve test reliability and maintainability - [tests] add alert module tests for different welcome_message configurations (#3867) -- [lint-staged] use `prettier --write --ignore-unknown` in `lint-staged` to avoid errors on unsupported files +- [lint-staged] use `prettier --write --ignore-unknown` in `lint-staged` to avoid errors on unsupported files (#3888) ### Updated