Skip to content

Commit b42c41e

Browse files
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
1 parent 08d29c3 commit b42c41e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Thanks to: @dathbe.
3939
- Avoid potential port conflicts by using port 3001 for translator unit tests
4040
- Improve test reliability and maintainability
4141
- [tests] add alert module tests for different welcome_message configurations (#3867)
42+
- [lint-staged] use `prettier --write --ignore-unknown` in `lint-staged` to avoid errors on unsupported files
4243

4344
### Updated
4445

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"test:unit": "NODE_ENV=test jest --selectProjects unit"
6565
},
6666
"lint-staged": {
67-
"*": "prettier --write",
67+
"*": "prettier --ignore-unknown --write",
6868
"*.js": "eslint --fix",
6969
"*.css": "stylelint --fix"
7070
},

0 commit comments

Comments
 (0)