prettier
dprint
Our great sponsors
prettier | dprint | |
---|---|---|
431 | 20 | |
47,979 | 2,885 | |
0.6% | 3.5% | |
9.8 | 8.8 | |
4 days ago | 3 days ago | |
JavaScript | Rust | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
prettier
-
Angular 14 + Prettier + Husky Setup
What is Prettier π?
-
π THE BEST AND MOST USEFUL VSCODE EXTENSIONS π
In this Thread, I won't show you little extensions that you probably already know, like Live Server or Prettier.
-
Why is Prettier rock solid?
1.1k isn't bad for a project with ~33 million weekly downloads[1], imo. Yes, I know that's not necessarily a good metric, but it's ~10 million more than React[2] which also has a similar number of open issues[3].
[1]: https://www.npmjs.com/package/prettier
Actually that comment derives onto this other issue, where the merits of the decision are discussed:
https://github.com/prettier/prettier/issues/15956
and to be honest, it didn't look like silly to me :) It was an interesting read for me, who as a maintainer, I tend to give more importance to the official statements such as in this case written recommendations of the source company that defined the new format.
Another example: https://github.com/prettier/prettier/issues/187
That issue has been open for 7 years.
For example, the latest Prettier makes XHTML files invalid by changing DOCTYPE to lowercase:
https://github.com/prettier/prettier/issues/15476
Prettier moves ts-ignore comments which can cause TypeScript errors:
https://github.com/prettier/prettier/issues/15876
Interpreting nested CSS functions' "-" as minus and inserting a space:
How can a person that introduces breaking changes in patch release and then just says everyone to piss off when facing critics (just because mister "has needs for this": https://github.com/prettier/prettier/issues/15553#issuecomme...) be a maintainer of such a widespread tool ?
Interestingly, prettier just made a breaking change in a patch release and refused to undo it for a week or so, until a particularly silly pedantic argument won them over.
https://github.com/prettier/prettier/issues/15942
My only bad experience with prettier, besides the incredible slowness (orders of magnitude slower than ruff)
- How to create a good README.md file
dprint
- Oxlint β written in Rust β 50-100 Times Faster than ESLint
-
How do I stop Prettier from de-structuring object properties onto separate lines?
Prettier is opinionated. dprint is highly configurable.
-
Rome v12.1: a Rust-based linter formatter for TypeScript, JSX and JSON
I mean, I know I am a bad person because of those long names, but that is how life goes sometimes! And the blank line there at the top is just very important to like, catch one's breath, while reading this code.
(I'm really just posting this in the hopes that somebody will throw me a "Bro, just use hpstrlnt, it totally lets you configure that!" -- I have not actually tried Rome to see if it does (it's Monday morning and I'm not quite ready to be disappointed again...))
[1]: dprint is good, and I recommend it as the best code formatter I currently know of: https://dprint.dev/
- What would you rewrite in Rust?
-
What's the best way to generate code?
If it's something in the vein of one of those things then, worst case, you generate the code first, then run it through something like dprint.
- Ask HN: Alternatives to Prettier?
-
Rome Formatter and Rust Update
If it's speed you are looking for, give dprint (https://github.com/dprint/dprint) a try, it has a vscode plugin too.
Why not dprint[1]? Does it not "produce a concrete syntax tree (CST) that represents the original code completely, whitespace, comments and all"?
I'm not terribly familiar with the architecture of dprint, but it's used in Deno with JS/TS plugin and works great so far.
-
Speed-up your Prettier formatting using prettierd
It is written in Rust, and the formatting is built into the Deno executable using a clone of Prettier https://dprint.dev/. You can use it as your main language server for web based JS/TS as well as Deno specific code.
-
Question about deno fmt
dprint is 99% the same as Prettier, I suggest you try it out and look at the diffs. I did, and reported any differences on https://github.com/dprint/dprint ... any differences all got fixed :)
What are some alternatives?
black - The uncompromising Python code formatter
JS-Beautifier - Beautifier for javascript
ESLint - Find and fix problems in your JavaScript code.
prettier-plugin-organize-imports - Make Prettier organize your imports using the TypeScript language service API.
Standard - π JavaScript Style Guide, with linter & automatic code fixer
JSHint - JSHint is a tool that helps to detect errors and potential problems in your JavaScript code
pretty-quick - β‘ Get Pretty Quick
markdownlint-cli - MarkdownLint Command Line Interface
intellij-rainbow-brackets - πRainbow Brackets for IntelliJ based IDEs/Android Studio/HUAWEI DevEco Studio/Fleet
spotless - Keep your code spotless
husky - Git hooks made easy πΆ woof!
PostCSS - Transforming styles with JS plugins