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
prettier-plugin-explicit-return has 2 recorded weekly downloads on npm, a decrease of 80.0% over the past 30 days, ranking #2154 of 2,256 tracked listings.
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
Usage
Add the plugin to your Prettier configuration:
.prettierrc.json:
package.json:
Then format your TypeScript files as usual:
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:
After:
Arrow Function
Before:
After:
Class Method
Before:
After:
Function Expression
Before:
After:
Async Function
Before:
After:
Existing Return Types (Skipped)
Functions with existing return types are left unchanged:
Before & After:
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:
- 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
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 (121)Similar npm Prettier plugins plugins
All 20 prettier-plugin-explicit-return 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-explicit-return. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.