chore: add prettier for formatting#39
Conversation
|
What would help is if we had a sort of global CTP prettifier file. It would be cool to upstream this, because right now a lot of our styling is...implicit, and as such depends on the user's own IDE and its setup as well. Similar to how userstyles have a customised deno fmt shell, but one for the major languages, such as whiskers files, js/ts, rust and others that might be relevant to their own repo (such as catppuccin/pygments handling the python formatter config, language-specific things are handled in the language-specific ports). |
|
We don't mandate any kind of styling org-wide, maintainers can choose what they prefer. This pull request only seeks to make it easier for contributors to contribute to this repository's existing code style without having additional unrelated formatting changes. |
But, this leads to those who seek to contribute new ports etc, being left rather confused or well, having an inconsistent styling of our ports. This would honestly be nicer to see having a singular style guide over the organisation, but perhaps this viewpoint is from my clinical OCD, but it's just my opinion! Not saying of course that it's what we should go with, just throwing it out there. :] |
|
Thanks for the PR, I'm actually kinda interested in using biome if we're going to be touching up the formatting. Mainly since it's a formatter and linter in one, and if it has good defaults then we can standardise on that slowly but surely? Is the new kid on the block worth it? Assuming it's still the new kid on the block lol |
|
I like Biome, but they still don't support YAML or Markdown. https://biomejs.dev/internals/language-support/ |
|
That's unfortunate, at least the formatting is in progress? If the website is to be trusted lol |
YAML is nearly done, and MD is in the works, afaik. It will be tempting an option in that case. I know we have deno as well, but deno is...well, messier in terms of added tools. prettier would be our best bet now, then biome when it ships. |
As pull requests are adding new things (#28) it might help to have some standard formatting. The existing formatting seems to follow standard/default Prettier conventions, so I've added that here. The only formatting changes are a few related to print width and missing trailing commas. I've ignored the autogenerated CHANGELOG.md and the pnpm lockfile in
.prettierignore.