prettier-plugin-minimal-parens weekly downloads statistics
By harshmoorjani · npm · Prettier plugins
Remove optional layout parentheses from JSX expressions, ternary branches, and multiline returns in Prettier.
prettier-plugin-minimal-parens has 303 recorded weekly downloads on npm, ranking #1619 of 2,322 tracked listings.
About prettier-plugin-minimal-parens
prettier-plugin-minimal-parens
A small Prettier 3 plugin that removes unnecessary outer parentheses from
multi-line return statements and JSX expressions, including .map() callbacks
and conditional rendering with &&, ||, ??, and ternaries. Loading the plugin enables the behavior;
there is no formatting option.
function View() {
return <main>
<Header />
<Content />
</main>;
}
Use in another project
After the first npm release, install from the registry:
npm install --save-dev "prettier@^3.9.10" prettier-plugin-minimal-parens
Or with Yarn:
yarn add --dev "prettier@^3.9.10" prettier-plugin-minimal-parens
Until that release, or to install a Git revision, use GitHub:
npm install --save-dev --save-exact prettier@3.9.10 github:harshmoorjani/prettier-plugin-minimal-parens
The Yarn equivalent is:
yarn add --dev prettier-plugin-minimal-parens@github:harshmoorjani/prettier-plugin-minimal-parens
GitHub installs do not require npm publication or a local checkout. If the
repository is private, Git needs GitHub access, including in CI. If you already
use GitHub CLI, gh auth setup-git --hostname github.com configures its login
as Git's credential helper.
Add the plugin to your project's .prettierrc.json:
{
"plugins": ["prettier-plugin-minimal-parens"]
}
If you already have a Prettier configuration, add prettier-plugin-minimal-parens to its
existing plugins array. The equivalent prettier.config.mjs is:
export default {
plugins: ["prettier-plugin-minimal-parens"],
};
Then format normally:
npx prettier --write path/to/file.tsx
For an existing Yarn project, use yarn prettier --write path/to/file.tsx or
your normal format script. Use the project's existing package manager.
Editors should use the project's installed Prettier and configuration. There is no extra option to enable: loading this plugin changes return formatting.
Commit your package manifest and lockfile so CI installs the same Git revision. To explicitly pin the plugin to a specific commit instead of the repository's default branch, use:
npm install --save-dev --save-exact prettier@3.9.10 "github:harshmoorjani/prettier-plugin-minimal-parens#<commit-sha>"
Replace <commit-sha> with the full SHA from this repository's commit history.
GitHub dependency installation is supported by npm's package specification.
Migrating from prettier-custom
If you installed the earlier GitHub package under the name prettier-custom,
replace that dependency and change its entry in your Prettier plugins array
to prettier-plugin-minimal-parens. Before the npm release, use:
yarn remove prettier-custom
yarn add --dev prettier-plugin-minimal-parens@github:harshmoorjani/prettier-plugin-minimal-parens
After the npm release, the second command can be
yarn add --dev prettier-plugin-minimal-parens.
Work on this plugin locally
npm install
npm run format -- path/to/file.tsx --write
npm test
The included prettier.config.mjs also enables the plugin for editors formatting
files inside this directory.
Publishing
Version 0.1.0 is prepared for the first npm release. From a clean checkout:
npm ci
npm login
npm publish --dry-run
npm publish
prepublishOnly runs the test suite before publishing. The package contains
only index.js, package.json, README.md, and LICENSE; there is no build
step. Prettier is a peer dependency and is not bundled.
The npm name must still be available when publishing. Authenticate with the npm account that should own the package and complete its required 2FA checks. See npm's publishing guide.
For subsequent releases, update the package version before publishing again.
Compatibility
Uses Prettier's built-in AST printer without rewriting source text. Necessary parentheses, comment handling, and formatting outside these expressions stay with Prettier. Tested with Prettier 3.9.10. Plugins that replace the JavaScript printer may conflict; this plugin does not merge other printers.
Coverage includes elements and fragments in explicit returns, arrow bodies,
callbacks, ternary branches (including nested and mixed branches), assignments,
arguments, object properties, arrays, JSX children and attributes, methods, and
yield expressions. Both standard and experimental ternary layouts are tested
with JavaScript, Babel TypeScript, and TypeScript parsers.
The regression suite checks AST equivalence and formatting stability, including
comments, semicolons, line widths, tabs, CRLF, range formatting, TypeScript casts,
and satisfies. Grouping needed for operator precedence, ternaries used as
conditions, object-literal arrow bodies, invocation/member access, and comments
is retained. prettier-ignore is respected.
License
The Unlicense: dedicated to the public domain. You may use, modify, and redistribute this plugin for any purpose, including commercially, without attribution. Provided without warranty. Prettier retains its own license.
Description from the npm listing.
- prettier
- prettier-plugin
- jsx
- tsx
- parentheses
- formatting
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (122)Similar npm Prettier plugins plugins
All 20 prettier-plugin-minimal-parens alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/prettier-plugin-minimal-parens. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.