-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code base seems to be non-formatted with Prettier #262
Comments
Once the configuration is added, I highly recommend formatting the entire code base to prevent any unexpected format-related diffs in the future. |
I’d rather not add a special config to avoid this, the point of prettier personally was to avoid configuration. That said, I’ll take a look and maybe migrate to https://github.com/borderless/ts-scripts anyway since I’ve standardized this setup for all other repos. |
I completely agree, yet I'm experiencing an issue when a clean fork without any additional VS Code settings mal-formats the code base of this project. I suspect some implicit Prettier config resolution at the place, but cannot point a finder on it just yet. An even bigger beauty of prettier is just being opinionated. I always add explicit configs even if they describe prettier's default. The latter can always change, as happened with prettier for javascript, if my memory serves right. In the end, it's about consistent code formatting and contributing experience. |
I'll take a look. I think that's actually my fault for merging a prettier update with applying the version I updated to at the same time. |
Thank you, @blakeembrey. Let me know if you need any help. I can set up a pre-commit hook that'd format any changes, ensuring no unformatted code gets committed. That, and a fixed Prettier configuration will be enough for a great experience. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Reformatted in the mega commit b45871b. I'm taking a look at your PR finally and will rebase if I can 😄 |
Thank you, @blakeembrey! |
The library is using Prettier to format the changes via
lint-staged
andnpm run prettier
command. When doing so, however, it formats the entire file, distorting the commit's diff. This makes contributing to the project extremely tedious.I believe the reason for that is the lack of the explicit Prettier configuration that'd tell Prettier how to format the code. It must be detecting some of my other Prettier configurations and formatting the code base accordingly.
Solution
Let's add an explicit
.prettierrc
configuration so that the formatting on the commit hook would produce a consistent result.The text was updated successfully, but these errors were encountered: