prettier --write --ignore-unknown
in lint-staged
to avoid errors on unsupported files (#3888)
This prevents `prettier` from failing when `lint-staged` passes unknown/binary files, making the pre-commit hook more robust. In concrete terms this could happen, when we, for example, add a new PNG file. Since we rarely do this, it has not been noticed so far. This is recommended when using asterisk: https://github.com/lint-staged/lint-staged#automatically-fix-code-style-with-prettier-for-any-format-prettier-supports ## before ```bash $ npx lint-staged <-- after staging a new PNG file ✔ Backed up original state in git stash (c3247d4b) ✔ Hiding unstaged changes to partially staged files... ⚠ Running tasks for staged files... ❯ package.json — 2 files ❯ * — 2 files ✖ prettier --write [FAILED] ↓ *.js — no files ↓ *.css — no files ↓ Skipped because of errors from tasks. ↓ Skipped because of errors from tasks. ✔ Reverting to original state because of errors... ✔ Cleaning up temporary files... ✖ prettier --write: [error] No parser could be inferred for file "~/MagicMirror/test.png". ... ``` ## after ```bash $ npx lint-staged <-- after staging a new PNG file ✔ Backed up original state in git stash (0c3fe285) ✔ Running tasks for staged files... ✔ Applying modifications from tasks... ✔ Cleaning up temporary files... ```
prettier --write --ignore-unknown
in lint-staged
to avoid errors on unsupported files (#3888)
prettier --write --ignore-unknown
in lint-staged
to avoid errors on unsupported files (#3888)
MagicMirror² is an open source modular smart mirror platform. With a growing list of installable modules, the MagicMirror² allows you to convert your hallway or bathroom mirror into your personal assistant. MagicMirror² is built by the creator of the original MagicMirror with the incredible help of a growing community of contributors.
MagicMirror² focuses on a modular plugin system and uses Electron as an application wrapper. So no more web server or browser installs necessary!
Documentation
For the full documentation including installation instructions, please visit our dedicated documentation website: https://docs.magicmirror.builders.
Links
- Website: https://magicmirror.builders
- Documentation: https://docs.magicmirror.builders
- Forum: https://forum.magicmirror.builders
- Technical discussions: https://forum.magicmirror.builders/category/11/core-system
- Discord: https://discord.gg/J5BAtvx
- Blog: https://michaelteeuw.nl/tagged/magicmirror
- Donations: https://magicmirror.builders/#donate
Contributing Guidelines
Contributions of all kinds are welcome, not only in the form of code but also with regards to
- bug reports
- documentation
- translations
For the full contribution guidelines, check out: https://docs.magicmirror.builders/about/contributing.html
Enjoying MagicMirror? Consider a donation!
MagicMirror² is Open Source and free. That doesn't mean we don't need any money.
Please consider a donation to help us cover the ongoing costs like webservers and email services. If we receive enough donations we might even be able to free up some working hours and spend some extra time improving the MagicMirror² core.
To donate, please follow this link.