Skip to content
PluginStats

prettier-plugin-smarty weekly downloads statistics

By dexbol · npm · Prettier plugins

Prettier plugin for Smarty templates with configurable delimiters (defaults to <{ ... }>).

View on npm Fresh · Dec 6, 2026

prettier-plugin-smarty has 56 recorded weekly downloads on npm, an increase of 5.7% over the past 30 days, ranking #2751 of 3,247 tracked listings.

Weekly downloads
56
Official API · Dec 5, 2026
7-day growth
+155%
+34 weekly downloads
30-day growth
+5.7%
+3 weekly downloads
90-day growth
+1020%
+51 weekly downloads
Rank
#2751
▲ 26 in 7 days

About prettier-plugin-smarty

prettier-plugin-smarty

A Prettier plugin for Smarty templates with configurable delimiters — defaults to <{ ... }> for codebases that override the standard {...} syntax.

Status: 0.1.0 — MVP. The plugin treats Smarty tags as opaque tokens, formats the surrounding HTML/CSS/JS with Prettier's built-in HTML formatter, then restores the tags. It does not reformat code inside Smarty tags. See Limitations before depending on it.

Why

Prettier doesn't have a Smarty parser. Projects that use custom delimiters like <{ ... }> (e.g. 6rooms/live_frontend) can't even use Prettier's HTML mode as a workaround, because <{ is invalid HTML and the parser rejects it.

This plugin works around that by replacing each Smarty construct with an HTML-shaped placeholder before formatting, then swapping the originals back in afterwards. Block tags (<{if}>...<{/if}>, <{foreach}>...<{/foreach}>, …) become <div> placeholders so HTML indentation tracks block boundaries correctly. Inline output (<{$var}>, <{include …}>) becomes an HTML comment so it stays on the same line as the surrounding text.

Install

npm install --save-dev prettier prettier-plugin-smarty

Then add to your .prettierrc (or .prettierrc.json):

{
	"plugins": ["prettier-plugin-smarty"]
}

Format a file:

npx prettier --write path/to/file.tpl

Options

OptionDefaultDescription
smartyOpenDelimiter<{Opening delimiter for Smarty tags.
smartyCloseDelimiter}>Closing delimiter for Smarty tags.

Example .prettierrc.json for a project that uses the stock {...} delimiters:

{
	"plugins": ["prettier-plugin-smarty"],
	"smartyOpenDelimiter": "{",
	"smartyCloseDelimiter": "}"
}

Note: with stock {...} delimiters there is more ambiguity (JS object literals, CSS rules, etc. all use braces). The plugin is primarily tested with <{ ... }>. Use stock delimiters at your own risk for now.

All standard Prettier options (printWidth, tabWidth, useTabs, singleQuote, htmlWhitespaceSensitivity, etc.) are forwarded to the underlying HTML formatter.

What gets formatted

  • HTML markup outside Smarty tags is reformatted by Prettier's HTML printer.
  • Indentation, tag wrapping, attribute placement follow standard Prettier HTML rules.
  • Block boundaries (<{if}>…<{/if}>, etc.) are preserved and the body is indented under them.
  • Embedded <script> and <style> are formatted by Prettier's JS / CSS printers (Prettier default behaviour).

What does NOT get formatted (limitations)

  • Anything inside Smarty tags. <{if $x eq "y" }> stays exactly like that. The plugin sees Smarty constructs as opaque strings.
  • Middle tags (<{else}>, <{elseif …}>, <{foreachelse}>) end up at the same indent as the block body, not at the block opener. The difference is one indent level — left as a v0.1 trade-off.
  • }> inside a Smarty tag is only recognized as a tag terminator when it appears outside single/double-quoted attribute strings. Edge cases like <{include file="x}>y"}> are handled, but exotic constructs may confuse the tokenizer.
  • Stock {...} delimiters are technically supported via options but not extensively tested. False positives on JS object literals or CSS braces are likely.
  • The plugin forces htmlWhitespaceSensitivity: "ignore" internally regardless of your config. This is required for clean block layout. Other Prettier options (printWidth, tabWidth, etc.) are honoured.

What will fail (you need a real Smarty parser for these)

Because the plugin sees Smarty tags as opaque, anything that uses Smarty to emit partial HTML breaks Prettier's HTML parser. Common patterns that won't format:

<{if $rank == 1}>
	<li class="number one">
<{else}>
	<li class="number">
<{/if}>
	...content...
</li>

Each branch opens part of an <li>; the placeholder substitution produces unbalanced HTML and Prettier rejects it. Similarly:

<{if $logged}><body class="user"><{else}><body class="guest"><{/if}>

Conditional opening of <body>, <head>, <script>, etc. all run into the same issue. Embedded PHP heredocs (<<<EOD) also break the HTML parser.

When the plugin can't format a file it throws Prettier's HTML error pointing at the offending tag. Add such files to your .prettierignore until a real Smarty parser is implemented.

Measured rate on 6rooms/live_frontend (1667 .tpl files): 63% format cleanly, 37% require .prettierignore. The failures cluster on a handful of legacy templates that use the partial-HTML pattern above.

Why placeholder approach instead of a real parser

Writing a real Smarty parser + printer is 1–2 weeks of work. The placeholder approach gets 80% of the practical value at a fraction of the cost. A future version may swap in a real parser if there's demand.

License

MIT

Description from the npm listing.

  • prettier
  • prettier-plugin
  • smarty
  • template
  • tpl

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

prettier-plugin-smarty weekly downloads on npm, last 90 days: 56 weekly downloads as of Dec 5, 2026, +1020% over 90 days.prettier-plugin-smartyWeekly downloads on npm · Last 90 days56downloads / week+1020% over 90 days020406080100120140160180Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
prettier-plugin-smarty weekly downloads on npm, last 90 days: 56 weekly downloads as of Dec 5, 2026, +1020% over 90 days.

7/30/90-day growth

prettier-plugin-smarty weekly downloads growth on npm: +155% over 7 days, +5.7% over 30 days, +1020% over 90 days.prettier-plugin-smartyWeekly downloads growth on npm56downloads / week now7-day growth+34 weekly downloads+155%30-day growth+3 weekly downloads+5.7%90-day growth+51 weekly downloads+1020%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-smarty weekly downloads growth on npm: +155% over 7 days, +5.7% over 30 days, +1020% over 90 days.

Ranking history

prettier-plugin-smarty npm ranking history: currently #2751 (by weekly downloads).prettier-plugin-smartynpm ranking · by weekly downloads · Last 90 days#2751current rank#500#1000#1500#2000#2500#3000Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-smarty npm ranking history: currently #2751 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 138, #11 (overall #2,751)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 6, #10 (overall #110)
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 (591)
Recent weekly downloads observations for prettier-plugin-smarty
Date (UTC)Weekly downloadsChange vs. previous
56+5
51+3
48+13
35+1
34+12
22+5
17-5
220
22-7
29-4
33+1
320
32-8
40—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-smarty 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-smarty. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.