Skip to content
PluginStats

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

By Generalsimus (2 listings) · 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 Fresh · Dec 6, 2026

prettier-plugin-hug-call-arguments has 249 recorded weekly downloads on npm, an increase of 215% over the past 30 days, ranking #2436 of 3,247 tracked listings.

Weekly downloads
249
Official API · Dec 5, 2026
7-day growth
-17.0%
-51 weekly downloads
30-day growth
+215%
+170 weekly downloads
90-day growth
-30.4%
-109 weekly downloads
Rank
#2436
▼ 159 in 7 days

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: 249 weekly downloads as of Dec 5, 2026, -30.4% over 90 days.prettier-plugin-hug-call-argumentsWeekly downloads on npm · Last 90 days249downloads / week-30.4% over 90 days0100200300400500600Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
prettier-plugin-hug-call-arguments weekly downloads on npm, last 90 days: 249 weekly downloads as of Dec 5, 2026, -30.4% over 90 days.

7/30/90-day growth

prettier-plugin-hug-call-arguments weekly downloads growth on npm: -17.0% over 7 days, +215% over 30 days, -30.4% over 90 days.prettier-plugin-hug-call-argumentsWeekly downloads growth on npm249downloads / week now7-day growth-51 weekly downloads-17.0%30-day growth+170 weekly downloads+215%90-day growth-109 weekly downloads-30.4%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-hug-call-arguments weekly downloads growth on npm: -17.0% over 7 days, +215% over 30 days, -30.4% over 90 days.

Ranking history

prettier-plugin-hug-call-arguments npm ranking history: currently #2436 (by weekly downloads).prettier-plugin-hug-call-argumentsnpm ranking · by weekly downloads · Last 90 days#2436current rank#1600#1800#2000#2200#2400#2600Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-hug-call-arguments npm ranking history: currently #2436 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 122, #16 (overall #2,436)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 4, #8 (overall #68)
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 (170)
Recent weekly downloads observations for prettier-plugin-hug-call-arguments
Date (UTC)Weekly downloadsChange vs. previous
249-126
375-8
383+63
320-7
327+1
326+9
317+17
300+168
132+12
120-10
130-1
131+21
110-24
134—

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 Dec 6, 2026. See the methodology.