Prettier Plugin for Scaffdog
raw JSON → 4.1.0 verified Sat Apr 25 auth: no javascript
A Prettier plugin for formatting scaffdog template syntax. Current stable version is 4.1.0, released with scaffdog monorepo. It automatically resolves scaffdog configuration to handle custom tags and Markdown file paths. Key differentiator: no manual configuration needed after install as Prettier auto-discovers the plugin. Active development with regular releases. Requires Node.js 18+. Supports TypeScript types for configuration.
Common errors
error [error] Unknown plugin: "prettier-plugin-scaffdog" ↓
cause Plugin not installed or not in node_modules
fix
Run npm install --save-dev prettier-plugin-scaffdog
error Error: Cannot find module '@scaffdog/engine' ↓
cause Missing peer dependency
fix
Check that @scaffdog/engine is installed (should be a dependency of prettier-plugin-scaffdog)
Warnings
breaking Requires Node.js 18 or later ↓
fix Upgrade Node.js to 18+ or use version 3.x if on older Node.js.
gotcha Plugin may not auto-resolve scaffdog project if run from a different directory ↓
fix Set scaffdogProject option in Prettier config file relative to that config file.
deprecated Config type export is new in 4.1.0; previously types were not exported ↓
fix Upgrade to 4.1.0 or later to use typed config.
Install
npm install prettier-plugin-scaffdog yarn add prettier-plugin-scaffdog pnpm add prettier-plugin-scaffdog Imports
- Config wrong
const { Config } = require('prettier-plugin-scaffdog')correctimport { Config } from 'prettier-plugin-scaffdog' - default (plugin object) wrong
const plugin = require('prettier-plugin-scaffdog')correctimport plugin from 'prettier-plugin-scaffdog'
Quickstart
// 1. Install
// npm install --save-dev prettier prettier-plugin-scaffdog
// 2. Create a scaffdog template file: example.md
// {{ inputs.name | camel }}
// 3. Format with Prettier
// npx prettier --write example.md
// 4. The file becomes:
// {{ inputs.name | camel }}
// Note: No manual plugin configuration needed; Prettier auto-detects it.