A Code Formatter is a tool that will make sure our code has a consistent style, in terms of indentation, naming patterns, white space and such. This list will be updated with the best code formatters I test.
Prettier
One of the most used code formatters, I personally use it everyday due to its support for many languages.
- JavaScript
- CSS
- Markdown
- YAML
- HTML
- GraphQL
Black
- https://pypi.org/project/black/
- Python formatter, focused on consistency.
”Blackened code looks the same regardless of the project you’re reading. Formatting becomes transparent after a while and you can focus on the content instead.”
Autopep8
autopep8 automatically formats Python code to conform to the PEP 8 style guide. It uses the pycodestyle utility to determine what parts of the code needs to be formatted. autopep8 is capable of fixing most of the formatting issues that can be reported by pycodestyle.