Gathering detailed insights and metrics for @prettier/plugin-pug
Gathering detailed insights and metrics for @prettier/plugin-pug
Gathering detailed insights and metrics for @prettier/plugin-pug
Gathering detailed insights and metrics for @prettier/plugin-pug
npm install @prettier/plugin-pug
Typescript
Module System
Min. Node Version
Node Version
NPM Version
91.9
Supply Chain
99.2
Quality
86.7
Maintenance
100
Vulnerability
99.6
License
TypeScript (62.78%)
Pug (35.62%)
Vue (1.41%)
JavaScript (0.19%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
206 Stars
1,159 Commits
44 Forks
2 Watchers
18 Branches
56 Contributors
Updated on May 23, 2025
Latest Version
3.4.0
Package Id
@prettier/plugin-pug@3.4.0
Unpacked Size
359.73 kB
Size
83.14 kB
File Count
39
NPM Version
10.8.2
Node Version
20.19.0
Published on
Apr 28, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
1
27
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
This plugin adds support for the Pug language to Prettier.
Simply install prettier
and @prettier/plugin-pug
as your project’s devDependencies
:
1npm add --save-dev prettier @prettier/plugin-pug 2# or 3yarn add --dev prettier @prettier/plugin-pug 4# or 5pnpm add --save-dev prettier @prettier/plugin-pug
1npx prettier --write "**/*.pug" --plugin="@prettier/plugin-pug" 2# or 3yarn prettier --write "**/*.pug" --plugin="@prettier/plugin-pug" 4# or 5pnpm prettier --write "**/*.pug" --plugin="@prettier/plugin-pug"
1{ 2 "plugins": ["@prettier/plugin-pug"] 3}
See Standard Prettier overrides and Pug specific options for more options.
1await prettier.format('code', { 2 parser: 'pug', 3 plugins: ['@prettier/plugin-pug'], 4});
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!
If you have tags at the top/root that are indented, they will lose indentation due to a technical limitation of pug.
Please check these before committing after running this plugin for the first time and fix them manually.
If you are using a text editor that supports Prettier integration (e.g. Atom), you can have all Prettier perks for your Pug code too!
Use VSCode extension to get support for VSCode.
In order to get @prettier/plugin-pug
working in projects that do not have local npm dependencies, you can install this plugin globally:
1npm install --global prettier @prettier/plugin-pug
In this case, you might need to check the settings of your editor’s Prettier extension to make sure that a globally installed Prettier is used when it is not found in project dependencies (i.e. package.json
).
Nevertheless, it is recommended to rely on local copies of prettier
and @prettier/plugin-pug
as this reduces the chance of formatting conflicts between project collaborators.
This may happen if different global versions of Prettier or its Pug plugin are used.
Installing @prettier/plugin-pug
either locally or globally may require you to restart the editor if formatting does not work right away.
This plugin is written in TypeScript and its quality is maintained using Prettier and Vitest.
If you’re interested in contributing to the development of Prettier for Pug, you can follow the CONTRIBUTING guide from Prettier, as it all applies to this repository too.
To run @prettier/plugin-pug
locally:
pnpm run preflight
.This project was inspired by https://github.com/gicentre/prettier-plugin-elm.
Many thanks also to @j-f1, @lipis and @azz for the help in transferring this repository to the prettier organization.
Thanks to @fisker for the constant help and support in terms of Prettier Core support.
Thanks to @Peilonrayz, who gave me the idea to rewrite the printer into a class and thus make the code a lot more maintainable.
Thanks to @lehni, @SkyaTura and @shadowgate15 for the massive contribution and the introduction of many new features into the project.
Thanks to @maoberlehner to acknowledge @prettier/plugin-pug
as officially well TTD tested at Vue Amsterdam 2023.
No vulnerabilities found.
Reason
18 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
all dependencies are pinned
Details
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
Found 2/9 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More