Formatters - brightstudent/backend GitHub Wiki

Formatters

Code formatters guarantee that your code is consistent across your project. This offers various advantages, including improved readability, increased transferability, and just saving you time and effort over writing everything yourself according to strict style requirements.

Formatters check for:

  • Indenting the code
  • Tabs vs spaces
  • Spaces in brackets
  • Spaces before and after brackets
  • Semicolons at the end of code
  • Single quotes vs double quotes
  • With or without commas after the code

My choice

Prettier is my preferred formatter. I write code in. HTML, CSS and JavaScript. And Prettier has support for all of those and many more programming languages. This is handy because I don't have to install multiple formatters for every programming language I use. Prettier is also available in most code editors and has a clear range of options, which are also customizable.