You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 10, 2020. It is now read-only.
Firstly, I would like to give a massive thanks to the BuckleScript team for an amazing project!
I had just cloned this repo as I want to make some improvements to the docs site, and I realized that when I went to edit any of the .md files, my editor was messing with the current formatting because I have the prettier extension installed. You have probably heard of prettier by now, but if you haven't, have a look at their website here.
I think prettier would make a great addition to the docs siterepo as it would format both the .md files that contain the documentation text, as well as the .js, .css and .html files that are used to build the site.
This would be useful because, from a quick look into the source files, I can see some inconsistencies in formatting. For example, sometimes trailing commas are used and sometimes they are not. It would also mean that possible new contributors (Like me!) wouldn't have to worry about how the project wants their files formatted, the editor / project would do it for me.
This could be done in two ways (Or both for better DX):
A prettier config file (.prettierrc) could be created at the root of the project, and a contributor's editor could recognize the file and format the files respecting these settings. The benefit of this approach is that it doesn't require much change. However, the issue is that if the contributor is not using the prettier plugin in their editor, or they just don't have one available, the code could be formatted wrong, and it would have to be changed before being merged.
A pre-commit hook could be added that runs prettier on the files that a contributor has staged. This would ensure that files commited to the repo were formatted correctly. The downside is that it adds a little bit more complexity to the project.
As mentioned above, I think that both 1 and 2 could be done together, so that when the contributor is developing, their editor will format the code correctly if they have the plugin installed, but if they don't then it doesn't matter because the pre-commit hook will format the files correctly anyway.
From what I have read of the source files, I think a config such as this would fit the project (Please correct this if it doesn't line up with the projects formatting style):
hi @joealden , thanks for your interest in contribution. Currently there are not many contributors to this repo, as one of primary contributors, I am not motivated to learn a new tool(there are too many js tools already). But I don't mind accept PR which contains whitespace diffs, thanks
Firstly, I would like to give a massive thanks to the BuckleScript team for an amazing project!
I had just cloned this repo as I want to make some improvements to the docs site, and I realized that when I went to edit any of the
.md
files, my editor was messing with the current formatting because I have the prettier extension installed. You have probably heard of prettier by now, but if you haven't, have a look at their website here.I think prettier would make a great addition to the docs siterepo as it would format both the
.md
files that contain the documentation text, as well as the.js
,.css
and.html
files that are used to build the site.This would be useful because, from a quick look into the source files, I can see some inconsistencies in formatting. For example, sometimes trailing commas are used and sometimes they are not. It would also mean that possible new contributors (Like me!) wouldn't have to worry about how the project wants their files formatted, the editor / project would do it for me.
This could be done in two ways (Or both for better DX):
.prettierrc
) could be created at the root of the project, and a contributor's editor could recognize the file and format the files respecting these settings. The benefit of this approach is that it doesn't require much change. However, the issue is that if the contributor is not using the prettier plugin in their editor, or they just don't have one available, the code could be formatted wrong, and it would have to be changed before being merged.As mentioned above, I think that both 1 and 2 could be done together, so that when the contributor is developing, their editor will format the code correctly if they have the plugin installed, but if they don't then it doesn't matter because the pre-commit hook will format the files correctly anyway.
From what I have read of the source files, I think a config such as this would fit the project (Please correct this if it doesn't line up with the projects formatting style):
Thanks for reading!
The text was updated successfully, but these errors were encountered: