Skip to content
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

Prettier alternatives #283

Open
grst opened this issue May 18, 2024 · 8 comments · May be fixed by #304
Open

Prettier alternatives #283

grst opened this issue May 18, 2024 · 8 comments · May be fixed by #304

Comments

@grst
Copy link
Collaborator

grst commented May 18, 2024

Prettier requires a full-blown node installation and is rather slow. Alternatives would be welcome.

Maybe we soon don't need prettier anymore: https://biomejs.dev/

It doesn't have yaml support yet though

Originally posted by @flying-sheep in #277 (comment)

@Zethson
Copy link
Member

Zethson commented Jun 20, 2024

https://github.com/pre-commit/mirrors-prettier

is now archived completely

@flying-sheep
Copy link
Member

flying-sheep commented Jun 20, 2024

I can’t add anything to what @henryiii said in prettier/prettier#15742 (comment)

Not just deprecated: the mirror was archived at 4.0.0-alpha.8. Without any notice on how to replace it, just the notice "prettier made some changes that breaks plugins entirely". 6,500 projects use this hook, including more than a dozen of mine.

… and the following comment:

the mirrors-prettier plugin seems to work perfectly fine for me without having to change anything from the example in the docs. i have no idea why asottile would archive the repo with such a useless, unhelpful message like "prettier made some changes that breaks plugins entirely" without any information as to what exactly the issue was, but that's to be expected considering how rude he is to anybody who tries to raise an issue on any of his projects.

pre-commit is just so damn convenient. If there was a trivial way to get auto-formatting of PRs working with just GitHub actions, maybe not using pre-commit would be a good path.

@flying-sheep flying-sheep linked a pull request Aug 23, 2024 that will close this issue
2 tasks
@flying-sheep
Copy link
Member

@g-plane said

How about considering dprint? It has more languages support which contains YAML.

@flying-sheep
Copy link
Member

flying-sheep commented Aug 29, 2024

@g-plane @grst please use the issue for discussion.

dprint looks interesting too! But:

  • They don’t have official pre-commit support (yet?): pre-commit integration dprint/dprint#442
  • They don’t plan to support EditorConfig: Support EditorConfig dprint/dprint#4
  • edit: Also there is little tool support, e.g. the VS Code extensions can’t download it and will instead use a global binary in $PATH (which users would need to provide themselves) or load it “from node_modules” (which doesn’t even exist in every npm project because of yarn 2)

@Avasam
Copy link

Avasam commented Sep 23, 2024

[...] will instead use a global binary in $PATH (which users would need to provide themselves) or load it “from node_modules” (which doesn’t even exist in every npm project because of yarn 2)

You can add "dprint.path": "node_modules/dprint/dprint" to your VSCode workspace settings

@henryiii
Copy link

FWIW, the mirrors suggested in the issue work fine, I've been using https://github.com/rbubley/mirrors-prettier and it's been fine.

@Avasam
Copy link

Avasam commented Sep 23, 2024

@henryiii Are you using a paid version of pre-commit.ci ? I thought that dprint downloading plugins at runtime would make it impossible to use with pre-commit.ci for free . dprint/dprint#442 (comment)

Edit: sorry I completely misread and interpreted as you saying you're using the dprint mirror....

@henryiii
Copy link

I'm using prettier, as you can see above. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants