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 · Oct 18, 2026

prettier-plugin-smarty has 73 recorded weekly downloads on npm, an increase of 1725% over the past 30 days, ranking #1779 of 2,322 tracked listings.

Weekly downloads
73
Official API · Oct 18, 2026
7-day growth
-40.7%
-50 weekly downloads
30-day growth
+1725%
+69 weekly downloads
90-day growth
+1360%
+68 weekly downloads
Rank
#1779
Among tracked npm listings

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: 73 weekly downloads as of Oct 18, 2026, +1360% over 90 days.prettier-plugin-smartyWeekly downloads on npm · Last 90 days73downloads / week+1360% over 90 days020406080100120140160180Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
prettier-plugin-smarty weekly downloads on npm, last 90 days: 73 weekly downloads as of Oct 18, 2026, +1360% over 90 days.

7/30/90-day growth

prettier-plugin-smarty weekly downloads growth on npm: -40.7% over 7 days, +1725% over 30 days, +1360% over 90 days.prettier-plugin-smartyWeekly downloads growth on npm73downloads / week now7-day growth-50 weekly downloads-40.7%30-day growth+69 weekly downloads+1725%90-day growth+68 weekly downloads+1360%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
prettier-plugin-smarty weekly downloads growth on npm: -40.7% over 7 days, +1725% over 30 days, +1360% over 90 days.

Ranking history

prettier-plugin-smarty npm ranking history: currently #1779 (by weekly downloads).prettier-plugin-smartynpm ranking · by weekly downloads · Last 90 days#1779current rank#600#800#1000#1200#1400#1600#1800Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 17, 2026 – Oct 20, 2026 · 4 observations · Updated Oct 18, 2026pluginstats.com
prettier-plugin-smarty npm ranking history: currently #1779 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,161 shown · page 90, #3 (overall #1,783)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins244 listings · 13 pages · page 4, #10 (overall #70)
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 (543)
Recent weekly downloads observations for prettier-plugin-smarty
Date (UTC)Weekly downloadsChange vs. previous
73+34
39-6
45-10
55-24
79-19
980
98-25
123-22
145-25
170+6
164+24
140+19
1210
121—

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 Oct 20, 2026. See the methodology.