Skip to content
PluginStats

prettier-plugin-detect-throw weekly downloads statistics

By JQuezada0 · npm · Prettier plugins

A Prettier plugin to detect and enforce rules for throw statements

View on npm Outdated · Nov 12, 2026

prettier-plugin-detect-throw has 4 recorded weekly downloads on npm, an increase of 33.3% over the past 30 days, ranking #3234 of 3,247 tracked listings.

Weekly downloads
4
Official API · Dec 5, 2026
7-day growth
-20.0%
-1 weekly downloads
30-day growth
+33.3%
+1 weekly downloads
90-day growth
+33.3%
+1 weekly downloads
Rank
#3234
▼ 122 in 7 days

About prettier-plugin-detect-throw

prettier-plugin-detect-throw

A Prettier plugin that identifies and highlights throw statements in your TypeScript code, optionally enforcing that only specific error classes are thrown.

Features

  • Highlight Throw Statements: Add comments above all throw statements for easy identification
  • Enforce Error Classes: Define allowed error classes and receive warnings for non-compliant throws
  • Flexible Configuration: Include or exclude files using glob patterns

Installation

# Using npm
npm install --save-dev prettier-plugin-detect-throw

# Using yarn
yarn add --dev prettier-plugin-detect-throw

# Using bun
bun add --dev prettier-plugin-detect-throw

Usage

Add the plugin to your Prettier configuration:

// .prettierrc.js
module.exports = {
  plugins: ["prettier-plugin-detect-throw"],
  highlightThrows: true,
  allowedErrorClasses: '["Error", "CustomError", "ValidationError"]',
  enforceAllowedClasses: true,
  include: '["**/*.ts", "**/*.tsx"]',
  exclude: '["**/node_modules/**"]',
}

Or as JSON:

{
  "plugins": ["prettier-plugin-detect-throw"],
  "highlightThrows": true,
  "allowedErrorClasses": "[\"Error\", \"CustomError\", \"ValidationError\"]",
  "enforceAllowedClasses": true,
  "include": "[\"**/*.ts\", \"**/*.tsx\"]",
  "exclude": "[\"**/node_modules/**\"]"
}

Configuration Options

OptionTypeDefaultDescription
highlightThrowsbooleanfalseWhen true, adds a /* THROW STATEMENT */ comment above each throw
allowedErrorClassesstring (JSON array)"[]"JSON string array of allowed error class names
enforceAllowedClassesbooleantrueWhen true, adds warning comments to throws that use non-allowed error classes
includestring (JSON array)"[\"**/*.ts\", \"**/*.tsx\"]"JSON string array of glob patterns for files to include
excludestring (JSON array)"[]"JSON string array of glob patterns for files to exclude

Example

Before:

function processData(data) {
  if (!data) {
    throw new Error("Data is required")
  }

  if (!isValid(data)) {
    throw new InvalidDataError("Invalid data format")
  }

  try {
    return transform(data)
  } catch (e) {
    throw e
  }
}

After (with highlightThrows: true and allowedErrorClasses: ["Error"]):

function processData(data) {
  if (!data) {
    /* THROW STATEMENT */
    throw new Error("Data is required")
  }

  if (!isValid(data)) {
    /* WARNING: Only throw instances of: Error */
    /* THROW STATEMENT */
    throw new InvalidDataError("Invalid data format")
  }

  try {
    return transform(data)
  } catch (e) {
    /* THROW STATEMENT */
    throw e
  }
}

Development

# Install dependencies
bun install

# Build as edits are made
bun run watch

# Build once
bun run build

# Typecheck
bun run typecheck

Description from the npm listing.

  • prettier
  • prettier-plugin
  • error
  • throw
  • exception

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-detect-throw weekly downloads on npm, last 90 days: 4 weekly downloads as of Dec 5, 2026, +33.3% over 90 days.prettier-plugin-detect-throwWeekly downloads on npm · Last 90 days4downloads / week+33.3% over 90 days01234567Sep 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-detect-throw weekly downloads on npm, last 90 days: 4 weekly downloads as of Dec 5, 2026, +33.3% over 90 days.

7/30/90-day growth

prettier-plugin-detect-throw weekly downloads growth on npm: -20.0% over 7 days, +33.3% over 30 days, +33.3% over 90 days.prettier-plugin-detect-throwWeekly downloads growth on npm4downloads / week now7-day growth-1 weekly downloads-20.0%30-day growth+1 weekly downloads+33.3%90-day growth+1 weekly downloads+33.3%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-detect-throw weekly downloads growth on npm: -20.0% over 7 days, +33.3% over 30 days, +33.3% over 90 days.

Ranking history

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

Listing placement

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

Listing placement

Prettier plugins267 listings · 14 pages · page 14, #4 (overall #264)
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-detect-throw
Date (UTC)Weekly downloadsChange vs. previous
40
4-3
70
7+2
5+1
40
4-1
50
5+2
30
30
30
30
3—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-detect-throw 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-detect-throw. First seen Oct 16, 2026; last successful collection Nov 12, 2026. See the methodology.