@seletskiy/plugin-pug weekly downloads statistics
By seletskiy · npm · Prettier plugins
Prettier Pug Plugin
@seletskiy/plugin-pug has 8 recorded weekly downloads on npm, an increase of 700% over the past 30 days, ranking #3170 of 3,247 tracked listings.
About @seletskiy/plugin-pug
Please note that the plugin ecosystem in Prettier is still beta, which may make <nobr>@prettier/plugin-pug</nobr> not ready for production use yet.
Plugin for Prettier to format pug code
You can disable code formatting for a particular code block by adding <nobr><!-- prettier-ignore --></nobr> before ```pug.
Pug code with custom formatting:
<!-- prettier-ignore -->
```pug
div.text( color = "primary", disabled ="true" )
```
Prettified code:
```pug
.text(color="primary", disabled)
```
Getting started
Simply install prettier and @prettier/plugin-pug as your project’s npm devDependencies:
cd /path/to/project
## initialise an npm project if you haven’t done it yet
npm init
## or
yarn init
## add Prettier and its Pug plugin to project’s dev dependencies
npm install --dev prettier @prettier/plugin-pug
## or
yarn add --dev prettier @prettier/plugin-pug
Usage
## format all pug files in your project
./node_modules/.bin/prettier --write "**/*.pug"
## or
yarn prettier --write "**/*.pug"
Prettier Options
printWidth
Currently not very accurate, but workssemi
If you want to configure different semi for pug than for js code, you can use prettier's override.{ "semi": false, "overrides": [ { "files": "*.pug", "options": { "parser": "pug", "semi": true } } ] }singleQuote
If you want to configure different quotes for pug than for js code, you can use prettier's override.{ "singleQuote": true, "overrides": [ { "files": "*.pug", "options": { "parser": "pug", "singleQuote": false } } ] }tabWidth
Use spaces for indentationuseTabs
Use tab for indentation OverridestabWidth
prettier-pug specific options
These are specific options only for prettier-pug
They should be set via Prettier's overrides option
-
attributeSeparator
Change when attributes are separated by commas in tags.Choices:
'always'default -> Always separate attributes with commas.
Example:button(type="submit", (click)="play()", disabled)'as-needed'-> Only add commas between attributes where required.
Example:button(type="submit", (click)="play()" disabled)
-
closingBracketPosition
Position of closing bracket of attributes.Choices:
-
'new-line'default -> Closing bracket ends with a new line.
Example:input( type="text", value="my_value", name="my_name", alt="my_alt", autocomplete="on" ) -
'last-line'-> Closing bracket remains with last attribute's line.
Example:input( type="text", value="my_value", name="my_name", alt="my_alt", autocomplete="on")
-
-
commentPreserveSpaces
Change behavior of spaces within comments.Choices:
'keep-all'default -> Keep all spaces within comments.
Example:// ___this _is __a __comment_'keep-leading'-> Keep leading spaces within comments.
Example:// ___this is a comment'trim-all'-> Trim all spaces within comments.
Example:// this is a comment
The definitions for these options can be found in src/options/index.ts
Some workarounds
There are some code examples that are not formatted well with this plugin and can damage your code.
But there are workarounds for it. These generate even better pug code!
Examples
input(onClick="methodname(\"" + variable + "\", this)")
// transforms to
input(onClick="methodname(\"\" + variable + \"\", this)")
// In most cases ES6 template strings are a good solution
input(onClick=`methodname("${variable}", this)`)
As mentioned in pugjs.org Attribute Interpolation (2.), you should prefere ES2015 template strings to simplify your attributes.
- const id = 42
- const collapsed = true
div(id=id, class='collapse' + (collapsed ? '' : ' show') + ' cardcontent')
// transforms to
.cardcontent(id=id, class="collapse' + (collapsed ? '' : ' show') + '")…
Description from the npm listing.
- pug
- prettier
- prettier-plugin
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 (170)Similar npm Prettier plugins plugins
All 20 @seletskiy/plugin-pug 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/@seletskiy/plugin-pug. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.