Skip to content
PluginStats

prettier-plugin-hug-call-arguments weekly downloads statistics

By Generalsimus · npm · Prettier plugins

Prettier plugin: hug the last call argument even when it's wrapped in another call, e.g. app.delete("/x", catchAsync(async (req, res) => { ... })). Fixes https://github.com/prettier/prettier/issues/11080

View on npm Stale · Oct 18, 2026

prettier-plugin-hug-call-arguments has 120 recorded weekly downloads on npm, a decrease of 77.6% over the past 30 days, ranking #1759 of 2,391 tracked listings.

Weekly downloads
120
Official API · Oct 18, 2026
7-day growth
-75.7%
-374 weekly downloads
30-day growth
-77.6%
-415 weekly downloads
90-day growth
—
Insufficient history
Rank
#1759
Among tracked npm listings

About prettier-plugin-hug-call-arguments

prettier-plugin-hug-call-arguments

license npm version npm downloads CI

Fixes prettier/prettier#11080.

Usage

Requires Prettier 3.x as a peer dependency.

npm install --save-dev prettier-plugin-hug-call-arguments
yarn add --dev prettier-plugin-hug-call-arguments
pnpm add --save-dev prettier-plugin-hug-call-arguments

Add it to your Prettier config (.prettierrc, .prettierrc.json, prettier.config.js, or the "prettier" key in package.json):

{
  "plugins": ["prettier-plugin-hug-call-arguments"]
}

No other options — it works automatically wherever Prettier already formats JS/JSX/TS/TSX with the estree printer (the babel, babel-ts, and typescript parsers). Nothing to configure, and every case it doesn't recognize is left to Prettier's own formatting untouched.

Examples

Prettier hugs the last argument of a call when it's a function/object/array literal:

app.get("/x", (req, res) => {
  res.send("ok");
});

...but not when that literal is wrapped in another call, which is a very common pattern for middleware wrappers (Express catchAsync, error boundaries, decorators-as-functions, etc.):

// input
app.delete('/campgrounds/:id', catchAsync(async (req, res) => {
  const { id } = req.params;
  await Campground.findByIdAndDelete(id);
  res.redirect('/campgrounds');
}));

// vanilla Prettier output
app.delete(
  "/campgrounds/:id",
  catchAsync(async (req, res) => {
    const { id } = req.params;
    await Campground.findByIdAndDelete(id);
    res.redirect("/campgrounds");
  }),
);

// with this plugin
app.delete("/campgrounds/:id", catchAsync(async (req, res) => {
  const { id } = req.params;
  await Campground.findByIdAndDelete(id);
  res.redirect("/campgrounds");
}));

It also flattens method chains instead of breaking every .method() onto its own line — a common look with query builders:

// input
db.updateTable('User').set({
  isDeleted: true,
  profilePicture: null,
  username: null,
}).where('id', '=', user.id).execute();

// vanilla Prettier output
db
  .updateTable("User")
  .set({
    isDeleted: true,
    profilePicture: null,
    username: null,
  })
  .where("id", "=", user.id)
  .execute();

// with this plugin
db.updateTable("User").set({
  isDeleted: true,
  profilePicture: null,
  username: null,
}).where("id", "=", user.id).execute();

How it works

This plugin wraps Prettier's built-in estree printer and only overrides the print step for CallExpression, ArrayExpression, ObjectExpression, ConditionalExpression, and ArrowFunctionExpression nodes that match one of a few narrow, specific shapes.

Preserving a layout you already chose:

// input
foo(
  1,
  2,
);

// with this plugin — kept exactly as written
foo(
  1,
  2,
);

// bar(1, 2, 3) stays on one line — nothing to preserve, so it's printed
// the normal, printWidth-aware way

Prettier already does this for object literals by default (objectWrap: "preserve"): write { with a newline before the first property and it stays multi-line, even if it would fit on one line. This plugin extends that same "respect how the author wrote it" behavior to call arguments, array elements, and arrow function parameter lists, which Prettier doesn't normally preserve — those always auto-collapse to fit printWidth regardless of the original formatting.

  • a list is split one item per line when there's a newline anywhere between its own items — right after the opening (/[/{, between two items, or right before the closing bracket — and at least two items. Objects get the same rule, extending Prettier's own "newline before the first key" check

  • newlines inside an item never count: every list decides for itself. A list written on one line stays on that line even when one of its items splits, and only that item breaks:

    // input
    foo([1, 2, [
      3, 4]], d);
    
    // output — the outer array and the call stay inline
    foo([1, 2, [
      3,
      4,
    ]], d);
    

    The same applies to a ternary written on one line (a ? foo([\n...\n]) : null). Either one falls back to Prettier's own layout when even its opening line wouldn't fit printWidth

  • takes priority over every other feature below: a layout you explicitly chose is never fought by this plugin's own hugging heuristics

  • bails on comments anywhere in the list, a sparse array, TS type arguments/parameters, or (for parameters) anything but a plain arrow function — a function expression/declaration has a name and block body to reproduce too, which is more than this narrow check takes on

Hugging a call-wrapped callback:…

Description from the npm listing.

  • prettier
  • prettier-plugin
  • formatter
  • code-style
  • call-arguments
  • callback
  • typescript

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

prettier-plugin-hug-call-arguments weekly downloads on npm, last 90 days: 120 weekly downloads as of Oct 18, 2026.prettier-plugin-hug-call-argumentsWeekly downloads on npm · Last 90 days120downloads / week02004006008001K1.2K1.4K1.6K1.8KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 23, 2026 – Oct 18, 2026 · 88 observations · Updated Oc…pluginstats.com
prettier-plugin-hug-call-arguments weekly downloads on npm, last 90 days: 120 weekly downloads as of Oct 18, 2026.

7/30/90-day growth

prettier-plugin-hug-call-arguments weekly downloads growth on npm: -75.7% over 7 days, -77.6% over 30 days, 90-day growth unavailable.prettier-plugin-hug-call-argumentsWeekly downloads growth on npm120downloads / week now7-day growth-374 weekly downloads-75.7%30-day growth-415 weekly downloads-77.6%90-day growth+120 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
prettier-plugin-hug-call-arguments weekly downloads growth on npm: -75.7% over 7 days, -77.6% over 30 days, 90-day growth unavailable.

Ranking history

prettier-plugin-hug-call-arguments npm ranking history: currently #1759 (by weekly downloads).prettier-plugin-hug-call-argumentsnpm ranking · by weekly downloads · Last 90 days#1759current rank#1640#1660#1680#1700#1720#1740#1760#1780Jul 23Aug 7Aug 22Sep 6Sep 21Oct 6Oct 21rankOct 18, 2026 – Oct 21, 2026 · 4 observations · Updated Oct 18, 2026pluginstats.com
prettier-plugin-hug-call-arguments npm ranking history: currently #1759 (by weekly downloads).

Listing placement

All npm2,389 listings · 120 pages · 1,195 shown · page 90, #7 (overall #1,787)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins244 listings · 13 pages · page 3, #20 (overall #60)
Prettier plugins: every listing in weekly downloads order

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)
Recent weekly downloads observations for prettier-plugin-hug-call-arguments
Date (UTC)Weekly downloadsChange vs. previous
1200
120-293
413+17
396-18
414-72
4860
486-8
494+6
488+237
251-250
501+2
499+40
459-29
488—

Data 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-hug-call-arguments. First seen Oct 16, 2026; last successful collection Oct 21, 2026. See the methodology.