Skip to content
PluginStats

prettier-plugin-explicit-return weekly downloads statistics

By gavinharris-dev · npm · Prettier plugins

A Prettier plugin that automatically adds explicit return type annotations to TypeScript functions using type inference

View on npm Fresh · Dec 6, 2026

prettier-plugin-explicit-return has 15 recorded weekly downloads on npm, an increase of 36.4% over the past 30 days, ranking #3053 of 3,247 tracked listings.

Weekly downloads
15
Official API · Dec 5, 2026
7-day growth
+36.4%
+4 weekly downloads
30-day growth
+36.4%
+4 weekly downloads
90-day growth
+400%
+12 weekly downloads
Rank
#3053
▼ 116 in 7 days

About prettier-plugin-explicit-return

Prettier Plugin Explicit Return

A Prettier plugin that automatically adds explicit return type annotations to TypeScript functions using type inference.

Installation

npm install --save-dev prettier-plugin-explicit-return

Usage

Add the plugin to your Prettier configuration:

.prettierrc.json:

{
  "plugins": ["prettier-plugin-explicit-return"]
}

package.json:

{
  "prettier": {
    "plugins": ["prettier-plugin-explicit-return"]
  }
}

Then format your TypeScript files as usual:

npx prettier --write "**/*.{ts,tsx}"

Features

This plugin automatically adds explicit return type annotations to:

  • ✅ Function declarations
  • ✅ Arrow functions
  • ✅ Class methods
  • ✅ Function expressions
  • ✅ Async functions (including Promise return types)

Functions that already have explicit return types are skipped to avoid duplication.

Examples

Function Declaration

Before:

function sum(a: number, b: number) {
  return a + b;
}

After:

function sum(a: number, b: number): number {
  return a + b;
}
Arrow Function

Before:

const multiply = (a: number, b: number) => {
  return a * b;
};

After:

const multiply = (a: number, b: number): number => {
  return a * b;
};
Class Method

Before:

class Calculator {
  add(a: number, b: number) {
    return a + b;
  }
}

After:

class Calculator {
  add(a: number, b: number): number {
    return a + b;
  }
}
Function Expression

Before:

const handler = function (event: string) {
  return event.length;
};

After:

const handler = function (event: string): number {
  return event.length;
};
Async Function

Before:

async function fetchData(url: string) {
  return fetch(url);
}

After:

async function fetchData(url: string): Promise<Response> {
  return fetch(url);
}
Existing Return Types (Skipped)

Functions with existing return types are left unchanged:

Before & After:

function testVoid(): void {
  console.log("testVoid");
}

How It Works

The plugin uses TypeScript's type checker to infer return types for functions that don't have explicit return type annotations. It:

  1. Parses your TypeScript code using TypeScript's compiler API
  2. Uses the type checker to infer return types
  3. Adds explicit return type annotations to functions that don't have them
  4. Preserves all formatting and existing code structure
  5. Works seamlessly with Prettier's formatting pipeline

Requirements

  • Node.js 14+
  • Prettier 3.6+
  • TypeScript 5.9+

License

MIT © 2025 Gavin Harris

Description from the npm listing.

  • prettier
  • prettier-plugin
  • typescript
  • return-types
  • type-annotations
  • code-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

prettier-plugin-explicit-return weekly downloads on npm, last 90 days: 15 weekly downloads as of Dec 5, 2026, +400% over 90 days.prettier-plugin-explicit-returnWeekly downloads on npm · Last 90 days15downloads / week+400% over 90 days0246810121416Sep 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-explicit-return weekly downloads on npm, last 90 days: 15 weekly downloads as of Dec 5, 2026, +400% over 90 days.

7/30/90-day growth

prettier-plugin-explicit-return weekly downloads growth on npm: +36.4% over 7 days, +36.4% over 30 days, +400% over 90 days.prettier-plugin-explicit-returnWeekly downloads growth on npm15downloads / week now7-day growth+4 weekly downloads+36.4%30-day growth+4 weekly downloads+36.4%90-day growth+12 weekly downloads+400%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-explicit-return weekly downloads growth on npm: +36.4% over 7 days, +36.4% over 30 days, +400% over 90 days.

Ranking history

prettier-plugin-explicit-return npm ranking history: currently #3053 (by weekly downloads).prettier-plugin-explicit-returnnpm ranking · by weekly downloads · Last 90 days#3053current rank#2000#2200#2400#2600#2800#3000#3200Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-explicit-return npm ranking history: currently #3053 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 153, #15 (overall #3,055)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 10, #18 (overall #198)
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-explicit-return
Date (UTC)Weekly downloadsChange vs. previous
150
15-1
16+6
100
100
100
10-1
110
11-3
140
140
14+1
130
13—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-explicit-return alternatives

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-explicit-return. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.