driftjs-prettier-plugin weekly downloads statistics
By hrutavmodha (2 listings) · npm · Prettier plugins
Prettier plugin for formatting DriftJS (.drift) Single File Components.
driftjs-prettier-plugin has 14 recorded weekly downloads on npm, unchanged over the past 30 days, ranking #3060 of 3,247 tracked listings.
About driftjs-prettier-plugin
driftjs-prettier-plugin
Official Prettier plugin for formatting DriftJS Single File Components (.drift).
Formats <script> blocks (via Prettier's Babel parser), <style> blocks (via Prettier's CSS parser), and DriftJS template markup with all directives (@if, @else if, @else, @for, @switch, @case, @default, @async, @fallback, @catch), dynamic interpolations, and attributes.
Features
- Drift SFC Formatting: Seamlessly parses and formats
.driftSingle File Components. - Embedded Languages: Formats
<script>logic with Babel and<style>sheets with CSS parsers. - Directives Support: Formats all Drift template directives with clean block structures and indentation.
- Dynamic Bindings: Formats dynamic interpolations
{expr}and attribute bindingsonclick={handler}. - Self-Closing Void Elements: Normalizes HTML void elements (
<input />,<img />,<hr />, etc.). - Prettier v3 Compatible: Built natively for Prettier v3 plugin architecture.
Installation
pnpm add -D driftjs-prettier-plugin prettier
Configuration
Add driftjs-prettier-plugin to your Prettier configuration file:
.prettierrc (JSON)
{
"plugins": ["driftjs-prettier-plugin"],
"tabWidth": 2,
"singleQuote": true,
"driftScriptIndent": true,
"driftStyleIndent": true,
"driftSelfCloseVoid": true
}
prettier.config.js (ESM)
export default {
plugins: ['driftjs-prettier-plugin'],
tabWidth: 2,
printWidth: 80,
driftScriptIndent: true,
driftStyleIndent: true,
driftSelfCloseVoid: true,
};
Options
| Option | Type | Default | Description |
|---|---|---|---|
driftScriptIndent | boolean | true | Whether to indent code inside <script> blocks. |
driftStyleIndent | boolean | true | Whether to indent code inside <style> blocks. |
driftSelfCloseVoid | boolean | true | Whether to self-close void HTML tags (e.g. <input /> vs <input>). |
CLI Usage
# Check formatting
pnpm prettier --check "**/*.drift"
# Format files in-place
pnpm prettier --write "**/*.drift"
License
MIT (c) 2026 Hrutav Modha
Description from the npm listing.
- driftjs
- prettier
- prettier-plugin
- formatter
- sfc
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 driftjs-prettier-plugin 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/driftjs-prettier-plugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.