theme-tools
theme-tools copied to clipboard
Respect .prettierignore when formatting local files
- partially fixes https://github.com/Shopify/theme-tools/issues/379
What are you adding in this PR?
Previously, the extension used liquid prettier plugin to format all files regardless of whether it was ignored by a .prettierignore file in the workspace. Although we aren't able to respect.prettierignore in all environments (for instance in browser or remote filesystems) we can in nodePrettierFormat
This PR checks for a .prettierignore at the workspace root and does not format files that .getFileInfo determines should be ignored
demo
https://github.com/user-attachments/assets/5a868e6d-9bd5-4123-a3ce-a495634b25a9
What did you learn?
- Unlike other prettier config:
Before you deploy
- [x] I included a minor bump
changeset - [x] My feature is backward compatible