Skip to content
PluginStats

@luzixu/prettier-plugin-block-padding weekly downloads statistics

By luzixu · 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

@luzixu/prettier-plugin-block-padding has 80 recorded weekly downloads on npm, a change of -45.6% over the past 7 days, ranking #2668 of 3,247 tracked listings.

Weekly downloads
80
Official API · Dec 5, 2026
7-day growth
-45.6%
-67 weekly downloads
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#2668
▼ 224 in 7 days

About @luzixu/prettier-plugin-block-padding

@luzixu/prettier-plugin-block-padding

Notice: This project is implemented entirely by AI coding tools.

中文文档

A Prettier plugin that inserts blank lines between selected statements and class members. It wraps Prettier's estree printer to control statement containers and separators, while leaving expression and object-property formatting to Prettier.

Key Features

The following describes the default behavior. The configuration options control rules, scope, and blank-line count.

  • All Code Blocks Grouping: Inserts an additional blank line before and after specific statements in file top-level, function bodies, if/for/while statement blocks, TypeScript namespaces, and class static initialization blocks (i.e., two line breaks separating adjacent statements), enhancing structural separation. Switch-case sequences remain delegated to Prettier because they are not block statements.
  • 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.
  • Class Member Separation: Pads multiline class members and separates adjacent properties and methods, including single-line methods.
  • Single-line Detection: Single-line blocks and expressions do not trigger additional blank lines, except for type declarations, object/array literals, and the property/method separation rule.
  • Parser Compatibility: Provides adapters for babel, babel-ts, and typescript, delegating to preceding compatible parsers or the official parser. Padding remains in the estree printing stage.

Behavior Details

With the default configuration, statement containers (Program, BlockStatement, TSModuleBlock, and StaticBlock) and class bodies (ClassBody) receive a blank line between adjacent statements or members in the following cases. See Configuration to select rules and spacing:

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, TSModuleDeclaration, etc.), an additional blank line is added between it and adjacent statements.

  • Class Declarations: The separate classes rule pads multiline class declarations by default; blockPaddingClassMode: "always" also includes single-line and empty classes.

  • Multi-line Expression Blocks: 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.
  • Padding Between Statements and Class Members: The plugin controls container braces and statement/member separators; expression and object-property formatting remains delegated to Prettier. Function bodies and other nested statement containers receive the same padding rules.
  • Single-line Exceptions: Type declarations, object/array literals, and adjacent class properties/methods can trigger padding even when printed on one line.

Adjacent statements are separated by a line break. Matching boundaries receive one additional line break by default, creating one 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 }…

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

@luzixu/prettier-plugin-block-padding weekly downloads on npm, last 90 days: 80 weekly downloads as of Dec 5, 2026.@luzixu/prettier-plugin-block-paddingWeekly downloads on npm · Last 90 days80downloads / week050100150200250300350Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@luzixu/prettier-plugin-block-padding weekly downloads on npm, last 90 days: 80 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

@luzixu/prettier-plugin-block-padding weekly downloads growth on npm: -45.6% over 7 days, 30-day growth unavailable, 90-day growth unavailable.@luzixu/prettier-plugin-block-paddingWeekly downloads growth on npm80downloads / week now7-day growth-67 weekly downloads-45.6%30-day growth+80 weekly downloadsInsufficient history90-day growth+80 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@luzixu/prettier-plugin-block-padding weekly downloads growth on npm: -45.6% over 7 days, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

@luzixu/prettier-plugin-block-padding npm ranking history: currently #2668 (by weekly downloads).@luzixu/prettier-plugin-block-paddingnpm ranking · by weekly downloads · Last 90 days#2668current rank#1600#1800#2000#2200#2400#2600#2800Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankNov 24, 2026 – Dec 6, 2026 · 13 observations · Updated Dec 5, 2026pluginstats.com
@luzixu/prettier-plugin-block-padding npm ranking history: currently #2668 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 134, #8 (overall #2,668)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 5, #16 (overall #96)
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 (128)
Recent weekly downloads observations for @luzixu/prettier-plugin-block-padding
Date (UTC)Weekly downloadsChange vs. previous
80+11
69+6
63+24
39-36
75-76
1510
151+4
147-2
149-2
151-3
154+38
116+61
55-279
334—

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/@luzixu/prettier-plugin-block-padding. First seen Nov 24, 2026; last successful collection Dec 6, 2026. See the methodology.