Registry / web-framework / prettier-plugin-antlers

prettier-plugin-antlers

JSON →
library2.0.5jsnpmunverified

Prettier plugin for formatting Antlers templates used in Statamic CMS. Current stable version is 2.0.5, supporting Prettier 3 (peer dependency >=3). The plugin uses the same formatting engine as Antlers Toolbox. Key differentiators: specifically for Antlers syntax, not generic HTML/Latte. Older v1.x supports Prettier 2, v2.x requires Prettier 3. Installation may require explicit plugin path reference in .prettierrc to avoid module resolution errors.

npm install prettier-plugin-antlers
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-AN
P
prettier-plugin-antlers
web-frameworkjavascriptv2.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

prettier-plugin-antlers
Add to `plugins` array in .prettierrc as 'prettier-plugin-antlers' or './node_modules/prettier-plugin-antlers/'
Trying to import in code with `const plugin = require('prettier-plugin-antlers')`
This is a Prettier plugin, not a library to require directly. Use via .prettierrc config.
antlers parser
Use `parser: 'antlers'` in config or CLI
Using parser: 'antlers.html' or 'antlers-html'
The parser identifier is exactly 'antlers'. Commonly mistaken as 'antlers.html' due to file extension.
require('prettier-plugin-antlers')
Do not require/import directly
const plugin = require('prettier-plugin-antlers')
The plugin is designed for Prettier's plugin system, not for direct programmatic use. Prettier 3 resolves plugins automatically if named correctly.

Minimal .prettierrc configuration to enable Antlers formatting with the plugin.

// .prettierrc { "plugins": ["prettier-plugin-antlers"], "overrides": [ { "files": ["*.antlers.html"], "options": { "parser": "antlers" } } ] }
prettier --version
Debug
Known issues
breakingPlugin v2 requires Prettier >=3. Installing @^2 with Prettier 2 will fail.
fix
Update Prettier to version 3 or higher, or install @^1 for Prettier 2 support.
affects: >=2.0.0
gotchaPrettier 2 may fail to resolve plugin with error 'Could not resolve module prettier-plugin-antlers' unless path is explicit.
fix
Use full path './node_modules/prettier-plugin-antlers/' in plugins array.
affects: >=1.0.0 <2.0.0
gotchaVS Code users get 'No formatter for Antlers found' if editor setting not configured.
fix
Add in VS Code settings.json: "[antlers]": {"editor.defaultFormatter": "esbenp.prettier-vscode"} and "prettier.documentSelectors": ["**/*.antlers.html"].
affects: >=1.0.0
gotchaPlugin does not include Tailwind CSS Prettier plugin; multi-class formatting may not work without it.
fix
Install @tailwindcss/prettier-plugin-typography separately and add to plugins list.
affects: >=1.0.0
Errors
Common errors & fixes
Could not resolve module prettier-plugin-antlers
Prettier 2 cannot find plugin via npm module resolution; or Prettier 3 misconfigured.
fix
For Prettier 2, use path './node_modules/prettier-plugin-antlers/' in .prettierrc. For Prettier 3, ensure plugin is installed and plugins list includes 'prettier-plugin-antlers'.
No formatter for 'Antlers' found
VS Code not configured to use Prettier for .antlers.html files.
fix
Add VS Code settings: "[antlers]": {"editor.defaultFormatter": "esbenp.prettier-vscode"} and "prettier.documentSelectors": ["**/*.antlers.html"].
Cannot find module 'prettier'
Missing peer dependency prettier, or version mismatch.
fix
Install correct Prettier version: for @^2, install prettier@^3; for @^1, install prettier@^2.
Upgrade
Version history
2.0.5latest on npm
Audit
Dependencies
prettierrequiredpeer dependency at version >=3 for v2.x, required
Agent activity
4 hits · last 30 days
node
4
Resources
prettier-plugin-antlers — npm install prettier-plugin-antlers · libregistry