Skip to main content
Version: 2.23 (prerelease)

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

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: [email protected]

Version string for the tool in the form package@version (e.g. [email protected])

Deprecated options

None

None