Skip to main content
Version: 2.29 (dev)

prettier


The Prettier utility for formatting JS/TS (and others) code (https://prettier.io/).

Backend: pants.backend.experimental.javascript.lint.prettier

Config section: [prettier]

Basic options

args

--prettier-args="[<shell_str>, <shell_str>, ...]"
PANTS_PRETTIER_ARGS
pants.toml
[prettier]
args = [
<shell_str>,
<shell_str>,
...,
]
default: []

Arguments to pass directly to Prettier, e.g. --prettier-args='--version'.

skip

--[no-]prettier-skip
PANTS_PRETTIER_SKIP
pants.toml
[prettier]
skip = <bool>
default: False

If true, don't use Prettier when running pants fmt and pants lint.

Advanced options

binary_name

--prettier-binary-name=<str>
PANTS_PRETTIER_BINARY_NAME
pants.toml
[prettier]
binary_name = <str>
default: None

Override the binary to run for this tool. Defaults to the package name.

install_from_resolve

--prettier-install-from-resolve=<str>
PANTS_PRETTIER_INSTALL_FROM_RESOLVE
pants.toml
[prettier]
install_from_resolve = <str>
default: None

If specified, install the tool using the lockfile for this named resolve, instead of the version configured in this subsystem.

If unspecified, the tool will use the default configured package manager [nodejs].package_manager`, and install the tool without a lockfile.

version

--prettier-version=<str>
PANTS_PRETTIER_VERSION
pants.toml
[prettier]
version = <str>
default: prettier@3.5.2

Version string for the tool in the form package@version (e.g. prettier@3.5.2)

Deprecated options

None

None