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 · Oct 17, 2026

prettier-plugin-block-padding has 1 recorded weekly downloads on npm, a decrease of 93.8% over the past 30 days.

It ranks #2187 of 2,256 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by 0.0%.

PluginStats has 543 daily observations since Apr 23, 2025; the latest is from Oct 17, 2026.

Weekly downloads
1
Official API · Oct 17, 2026
7-day growth
-91.7%
-11 weekly downloads
30-day growth
-93.8%
-15 weekly downloads
90-day growth
0.0%
0 weekly downloads
Rank
#2187
Among tracked npm listings

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: ... • 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:

Function Body Example

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

Multi-line Expression Block Example

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

Single-line Does Not Trigger Blank Lines

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

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

Installation

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):

Compatibility

• Prettier: v3 and above (loaded as a plugin) • Parsers: babel, babel-ts, typescript • Module: ESM

⚠️ Important Notice

There are serious compatibility issues with the "@ianvs/prettier-plugin-sort-imports" plugin. Please do not use them together!

Scope and Limitations

• Inserts additional blank lines "between statements" in all code blocks (including file top-level, function bodies, if/for/while statement blocks, TS namespace blocks). • Supported expression block types: template literals, tagged templates (e.g., styled-components), arrow functions, function expressions, class expressions, multi-line function calls, new expressions, JSX elements, and fragments. • Does not rewrite formatting inside expressions or object properties, and does not affect comment positions or line-breaking decisions (handled by Prettier). • Will not arbitrarily add extra blank lines at the beginning/end of files/blocks. • Single-line expressions (except object/array literals) do not trigger blank lines, avoiding excessive separation.

Quick Local Testing

Or use the project script (if exists):…

Description from the npm listing.

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

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

prettier-plugin-block-padding weekly downloads on npm, last 90 days: 1 weekly downloads as of Oct 17, 2026, 0.0% over 90 days.prettier-plugin-block-paddingWeekly downloads on npm · Last 90 days1downloads / week0.0% over 90 days010203040Jul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 21, 2026 – Oct 17, 2026 · 89 observations · Updated Oc…pluginstats.com
prettier-plugin-block-padding weekly downloads on npm, last 90 days: 1 weekly downloads as of Oct 17, 2026, 0.0% over 90 days.
PNG SVG

7/30/90-day growth

prettier-plugin-block-padding weekly downloads growth on npm: -91.7% over 7 days, -93.8% over 30 days, 0.0% over 90 days.prettier-plugin-block-paddingWeekly downloads growth on npm1downloads / week now7-day growth-11 weekly downloads-91.7%30-day growth-15 weekly downloads-93.8%90-day growth+0 weekly downloads0.0%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
prettier-plugin-block-padding weekly downloads growth on npm: -91.7% over 7 days, -93.8% over 30 days, 0.0% over 90 days.
PNG SVG

Ranking history

prettier-plugin-block-padding npm ranking history: currently #2187 (by weekly downloads).prettier-plugin-block-paddingnpm ranking · by weekly downloads · Last 90 days#2187current rank#600#800#1000#1200#1400#1600#1800#2000#2200Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 17, 2026 – Oct 19, 2026 · 3 observations · Updated Oct 17, 2026pluginstats.com
prettier-plugin-block-padding npm ranking history: currently #2187 (by weekly downloads).
PNG SVG

Listing placement

All npm2,256 listings · 113 pages · 1,130 shown · page 110, #8 (overall #2,188)
All npm: every listing in weekly downloads order
PNG SVG

Listing placement

Prettier plugins244 listings · 13 pages · page 10, #7 (overall #187)
Prettier plugins: every listing in weekly downloads order
PNG SVG

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 log 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 (543)
Recent weekly downloads observations for prettier-plugin-block-padding
Date (UTC)Weekly downloadsChange vs. previous
10
1+1
0-1
10
10
1-9
10-2
12-1
13-1
14-1
150
150
15+9
6—

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 Oct 19, 2026. See the methodology.