prettier-plugin-angular weekly downloads statistics
By p-otero · npm · Prettier plugins
Prettier plugin for Angular HTML attribute alignment and sorting
prettier-plugin-angular has 1,925 recorded weekly downloads on npm, an increase of 15.5% over the past 30 days, ranking #1897 of 3,247 tracked listings.
About prettier-plugin-angular
prettier-plugin-angular
A Prettier plugin for Angular HTML templates that formats, aligns, and sorts element attributes.
What it does
Attribute alignment
Attributes are formatted using the minimum number of lines needed:
-
Single line — if everything fits within
printWidth:<input type="text" [value]="v" /> -
Aligned — first attribute inline with the tag, rest aligned to the same column:
<p-select [options]="companiesForSelector()" [attr.aria-invalid]="form.controls.companyId.invalid" id="companyId" class="w-full" filter showClear /> -
Fallback — if the tag itself is too long to inline the first attribute, each attribute on its own line indented by
tabWidth:<my-very-long-component-name [options]="items" (change)="onChange($event)" class="w-full" />
Attribute sorting
Attributes are sorted by category in this order:
| Category | Examples |
|---|---|
ref | #myRef |
structural | *ngIf, *ngFor |
twoWay | [(ngModel)] |
input | [value], [disabled], [attr.aria-label] |
output | (click), (ngModelChange) |
animation | [@fadeIn] |
static | id="x", class="foo", formControlName="x" |
boolean | disabled, required, showIcon |
Self-closing elements
Elements with no real children are always output as self-closing, regardless of how they were written in the source:
<!-- Input -->
<app-my-component [value]="x" [label]="y"></app-my-component>
<!-- Output -->
<app-my-component [value]="x" [label]="y" />
This also applies to elements with only whitespace between their tags.
Angular control flow formatted
Elements inside @if, @for, @switch, @defer and other Angular control flow blocks are fully formatted — not emitted verbatim:
@if (form.controls.companyId.invalid && form.controls.companyId.touched) {
<small id="companyId-error" class="p-error block mt-1" role="alert">
{{ 'validation.required' | translate }}
</small>
}
Install
npm install -D prettier-plugin-angular
Configure
In .prettierrc:
{
"plugins": ["prettier-plugin-angular"],
"overrides": [
{
"files": "*.html",
"options": {
"parser": "angular-attributes",
"angularAttributeSort": true
}
}
]
}
Options
| Option | Type | Default | Description |
|---|---|---|---|
angularAttributeSort | boolean | true | Sort attributes by category |
angularAttributeOrder | string[] | ["ref","structural","twoWay","input","output","animation","static","boolean"] | Category order (any subset, in your preferred order) |
Full example
Input:
<p-select class="w-full" (change)="onChange($event)" [options]="items" inputId="x" #sel showIcon />
Output:
<p-select [options]="items"
(change)="onChange($event)"
inputId="x"
class="w-full"
#sel
showIcon />
Description from the npm listing.
- prettier
- prettier-plugin
- angular
- html
- formatter
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 prettier-plugin-angular 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/prettier-plugin-angular. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.