prettier VS black

Compare prettier vs black and see what are their differences.

Our great sponsors
  • Scout APM - A developer's best friend. Try free for 14-days
  • Nanos - Run Linux Software Faster and Safer than Linux with Unikernels
  • SaaSHub - Software Alternatives and Reviews
prettier black
138 110
41,318 23,840
1.1% 2.0%
9.9 9.4
4 days ago 1 day ago
JavaScript Python
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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

Posts with mentions or reviews of prettier. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-12-06.

black

Posts with mentions or reviews of black. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-12-03.
  • Plugin to set up Vim Python autoindenting to follow `black` conventions
    2 projects | reddit.com/r/neovim | 3 Dec 2021
    You can almost get black settings using the default indentexpr shipped with Neovim (GetPythonIndent from "runtime/indent/python.vim") by appriopriately specifying three configuration variables appropriately:
  • Julia 1.7 has been released
    15 projects | news.ycombinator.com | 30 Nov 2021
    I don't understand how it's ever an actual problem and not just people being lazy / literally just starting out learning the language. Every Python-capable editor / IDE is capable of, and immediately will, notify you of any formatting issues of the sort. Python also has great, trivial to use autoformatters like black[1] that essentially all production code should use.

    What realistic scenario is there where it actually makes sense deviating from the standard the language is trying to enforce?

    [1] https://github.com/psf/black

  • Cómo evaluar su lugar de trabajo actual
    3 projects | dev.to | 30 Nov 2021
  • How to evaluate your current workplace
    3 projects | dev.to | 29 Nov 2021
    Automated quality assurance on the fundamental level. Tools such as eslint & prettier on the frontend; Flake8 & black in python help you ensure code-style consistency & protects from the simplest errors you could introduce to your codebase. Setting them up & applying all initial changes takes time, but the most difficult is to get all team members on board & get them to use those tools consistently - especially before merging the changes to the main branch.
  • My first Django project
    2 projects | reddit.com/r/django | 15 Nov 2021
    Your code style is pretty inconsistent. Consistency makes code nicer to read, so I would recommend you look into linters (flake8, or pylint), and also code formatters (black). Never worry about forgetting to put a blank line at the end of the file, or leaving 5. (Also, it makes your git commits cleaner, because it automatically adds things like dangling commas, so if you add something to a list, it doesn't change the previous line).
  • Support Python 3.10 pattern matching syntax · Issue #2242 · psf/black
    1 project | news.ycombinator.com | 13 Nov 2021
  • Music Synthesis with python
    6 projects | reddit.com/r/Python | 10 Nov 2021
    GitHub Repo
  • Python Code Quality - Improve the quality of your Python code with linters, code formatters, and security vulnerability scanners
    7 projects | reddit.com/r/Python | 7 Nov 2021
    yaml repos: - repo: https://github.com/myint/autoflake rev: v1.4 hooks: - id: autoflake args: - --in-place - --remove-all-unused-imports - --expand-star-imports - --remove-duplicate-keys - --remove-unused-variables - repo: https://github.com/asottile/pyupgrade rev: v2.29.0 hooks: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/PyCQA/isort rev: 5.9.3 hooks: - id: isort - repo: https://github.com/psf/black rev: 21.10b0 hooks: - id: black args: [--safe, --quiet] - repo: https://github.com/PyCQA/flake8 rev: 4.0.1 hooks: - id: flake8 - repo: local hooks: - id: pylint name: pylint entry: pylint language: system types: [python] args: [ "-rn", "-sn", ] - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.910-1 hooks: - id: mypy name: mypy entry: mypy language: python types: [python] args: [] require_serial: true - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.4.1 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88]
  • Help with int
    1 project | reddit.com/r/learnpython | 6 Nov 2021
  • 2 Static Analysis Tools to Enhance Your Productivity
    5 projects | dev.to | 5 Nov 2021
    repos: - repo: https://github.com/psf/black rev: 21.10b0 hooks: - id: black - repo: https://github.com/pycqa/flake8 rev: 4.0.1 hooks: - id: flake8

What are some alternatives?

When comparing prettier and black you can also consider the following projects:

yapf - A formatter for Python files

autopep8 - A tool that automatically formats Python code to conform to the PEP 8 style guide.

isort - A Python utility / library to sort imports.

JS-Beautifier - Beautifier for javascript

JSHint - JSHint is a tool that helps to detect errors and potential problems in your JavaScript code

ESLint - Find and fix problems in your JavaScript code.

Standard - 🌟 JavaScript Style Guide, with linter & automatic code fixer

awesome-python-typing - Collection of awesome Python types, stubs, plugins, and tools to work with them.

Pylint - It's not just a linter that annoys you!

mypy - Optional static typing for Python

Drawflow - Simple flow library 🖥️🖱️

husky - Git hooks made easy 🐶 woof!