To practice, I worked on refactoring my dodo-SSG project in a new branch that I called refactoring. I started by fixing the code format from previous contributions using prettier. I then changed the code to get rid of global variables. To do that, I had to split up some code into separate smaller functions. At each of these steps, I created a new commit to make sure I could easily go back to the previous version... - Source: dev.to / 4 days ago
Author here! I used to have strong feelings about formatting stuff like this, but I since realised there are better things to spend effort on. For formatting, I just let https://prettier.io/ do it's thing, and it added the />. Although I do configure it to use single quotes in JS, so I guess I still have some opinion there. In terms of HTML, how far does your "but it isn't necessary" opinion go? Lots of closing... - Source: Hacker News / 6 days ago
I currently use json_encode($text, JSON_PRETTY_PRINT) which is really great, but I need a bit more flexibility, or something more sensible like https://prettier.io/. - Source: Reddit / 7 days ago
Prettier is an opinionated code formatter which is compatible with most of the languages. It saves a lot of time. It quickly indents our code on save (depends on VSCode/editor settings). - Source: dev.to / 25 days ago
Depends a bit on your stack, but when working with js/ts, prettier is the go-to formatter (black for python), and husky is the go-to pre-commit hook tool. I'm fairly confident all major IDEs will have support for format on save. If your IDE doesn't, maybe google it and see if another IDE with support for it exists. Ususally, there will at least be a plugin/extension for it. In the case it doesn't exist - really,... - Source: Reddit / 28 days ago
The first tool I want to explore is Prettier. I would leave it to you to read more about what it is but, in short, it is a code formatter. What does it mean? It means that it will keep your codebase consistent (in terms of coding style). Do you use ;? If yes, it will ensure that all your files have it, for example. I like it for two reasons: we barely have to discuss code formatting and it is easy to onboard new... - Source: dev.to / 29 days ago
It took me some time to go through Hung's code and to clearly understand all the logic behind it. Since the beginning of my studies at Seneca, I have done a lot of code writing but very little code reading. Everyone has a different coding style so I understand why big projects tend to use clear guidelines when it comes to code formatting (for example using Prettier). - Source: dev.to / about 1 month ago
It looks like you're using a very opinionated code style linter that doesn't just autofix your code for you. I would advise you to use prettier as it will automatically format your code in a consistent style, and eslint for linting other code quality issues as it is by far the most popular linter for JS today. However these are very subjective opinions and I'm sure some will disagree with me. - Source: Reddit / about 1 month ago
Do you know an article comparing Prettier to other products?
Suggest a link to a post with product alternatives.