Skip to content
PluginStats

prettier-plugin-block-padding weekly downloads statistics

By 1adybug (2 listings) · npm · Prettier plugins

A Prettier plugin that intelligently adds blank lines around code blocks for better visual grouping

View on npm Fresh · Dec 6, 2026

prettier-plugin-block-padding has 32 recorded weekly downloads on npm, an increase of 23.1% over the past 30 days, ranking #2877 of 3,247 tracked listings.

Weekly downloads
32
Official API · Dec 5, 2026
7-day growth
+700%
+28 weekly downloads
30-day growth
+23.1%
+6 weekly downloads
90-day growth
+433%
+26 weekly downloads
Rank
#2877
▲ 256 in 7 days

About prettier-plugin-block-padding

prettier-plugin-block-padding

中文文档

Important Notice: This project is entirely generated by Cursor + Claude 4.5 Sonnet Thinking

A Prettier plugin that intelligently inserts blank lines between specific statements to enhance visual grouping of modules and semantic blocks, without altering Prettier's original style and line-breaking decisions. The plugin works on "statement sequences" based on Prettier 3's estree printer, supports all code blocks (including function bodies, if/for/while statement blocks), and does not rewrite formatting and indentation inside expressions.

Key Features

  • All Code Blocks Grouping: Inserts an additional blank line before and after specific statements in all code blocks, including file top-level, function bodies, if/for/while statement blocks (i.e., two line breaks separating adjacent statements), enhancing structural separation.
  • Smart Multi-line Expression Block Recognition: Automatically identifies and adds blank lines around multi-line expression blocks such as template literals, function expressions, class expressions, JSX elements, etc., improving code readability.
  • TypeScript Namespace Support: Applies the same rules to member statements inside namespace/module (TSModuleBlock), ensuring correct line breaks between braces and first/last lines.
  • Smart Single-line Detection: Single-line objects, functions, template literals, etc., do not trigger additional blank lines (except object/array literals), avoiding excessive separation.
  • Collaboration with Official Parsers: Reuses official babel, babel-ts, and typescript parsers, only overriding the "statement concatenation" during the estree printing stage, leaving other formatting to Prettier.

Behavior Details

In "all code blocks (BlockStatement)", including file top-level (Program), function bodies, if/for/while statement blocks, and TypeScript namespace blocks (TSModuleBlock), the plugin adds an additional blank line between adjacent statements in the following cases:

Unconditional Blank Lines (Even for Single Lines)
  • TypeScript Type Declarations: interface, type, enum (including those wrapped with export)
  • Top-level Object/Array Literals:
    • Variable declarations initialized with object/array literals
    • Expression statements with literals as the main body
Blank Lines Only for Multi-line Cases
  • Multi-line Block Statements: When a statement's printed result is multi-line (e.g., if, for, while, do/while, try/catch/finally, switch, function, class, TSModuleDeclaration, etc.), an additional blank line is added between it and adjacent statements.

  • Multi-line Expression Blocks (New): When the following expressions span multiple lines, an additional blank line is added between them and adjacent statements:

    • Template literals: `...`
    • Tagged templates: styled`...`
    • Arrow function expressions: () => {}
    • Function expressions: function() {}
    • Class expressions: class {}
    • Multi-line function calls: fn(...)
    • Multi-line new expressions: new Class(...)
    • JSX elements: <div>...</div>
    • JSX fragments: <>...</>
Strict Constraints
  • No Blank Lines Outside Container Boundaries: Will not add extra blank lines before the file's first line or after the file's last line. However, if the file's first or last line's statement matches the above rules (e.g., object literals, type declarations, multi-line block statements), it will still add blank lines between it and adjacent statements.
  • Only Blank Lines Between Statements: Never rewrites formatting within a single statement; specific layouts of expressions, object properties, and function bodies are still determined by Prettier.
  • Single-line Does Not Trigger Blank Lines: When a block/expression is finally printed as a single line (without line breaks), it does not trigger additional whitespace.

Summary: The plugin always ensures "at least one line break between adjacent statements", and when rules are matched, an additional line break is added to form a visual blank line.

Examples

Basic Example (Top-level)

Object/array literals, TS type declarations, and multi-line block statements trigger additional whitespace:

const a = 1

const b = {
    name: "Tom",
    age: 18,
}

if (a) {
    const d = 1
}

interface User {
    name: string
}

const c = [1, 2, 3]
Function Body Example

The plugin also works inside function bodies, if/for/while, and all code blocks:

function foo() {
    const a = 1

    const b = {
        name: "Tom",
        age: 18,
    }

    if (a) {
        const x = 1

        const y = {
            name: "Jerry",
            age: 20,
        }
    }

    const c = [1, 2, 3]
}
Multi-line Expression Block Example

Template literals, function expressions, etc., spanning multiple lines also add blank lines:

const a = 1

const template = `
    hello, world!
    this is a multiline template
`

const fn = () => {
    console.log("test")
}

const b = 2

const styled = css`
    color: red;
    font-size: 14px;
`

const c = 3
Single-line Does Not Trigger Blank Lines

Single-line template literals, function expressions, etc., do not add blank lines:

const singleTemplate = `hello`
const singleFn = () => console.log("test")
const d = 4

Note: Single-line object/array literals still add blank lines (unconditional rule):

const a = 1

const singleObj = { a: 1 }

const b = 2

Installation

npm i -D prettier-plugin-block-padding

Usage

Add the plugin to your Prettier configuration (recommended to place at the end of the plugins array to ensure the custom estree printer takes effect):…

Description from the npm listing.

  • prettier
  • prettier-plugin
  • formatter
  • code-formatting
  • blank-lines
  • spacing
  • block-padding
  • typescript
  • javascript

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-block-padding weekly downloads on npm, last 90 days: 32 weekly downloads as of Dec 5, 2026, +433% over 90 days.prettier-plugin-block-paddingWeekly downloads on npm · Last 90 days32downloads / week+433% over 90 days05101520253035Sep 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-block-padding weekly downloads on npm, last 90 days: 32 weekly downloads as of Dec 5, 2026, +433% over 90 days.

7/30/90-day growth

prettier-plugin-block-padding weekly downloads growth on npm: +700% over 7 days, +23.1% over 30 days, +433% over 90 days.prettier-plugin-block-paddingWeekly downloads growth on npm32downloads / week now7-day growth+28 weekly downloads+700%30-day growth+6 weekly downloads+23.1%90-day growth+26 weekly downloads+433%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-block-padding weekly downloads growth on npm: +700% over 7 days, +23.1% over 30 days, +433% over 90 days.

Ranking history

prettier-plugin-block-padding npm ranking history: currently #2877 (by weekly downloads).prettier-plugin-block-paddingnpm ranking · by weekly downloads · Last 90 days#2877current rank#500#1000#1500#2000#2500#3000#3500Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-block-padding npm ranking history: currently #2877 (by weekly downloads).

Listing placement

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

Listing placement

Prettier plugins267 listings · 14 pages · page 8, #5 (overall #145)
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 (592)
Recent weekly downloads observations for prettier-plugin-block-padding
Date (UTC)Weekly downloadsChange vs. previous
320
320
32+20
12+1
11+9
20
2-2
4-3
7-10
170
170
170
170
17—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-block-padding 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-block-padding. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.