Registry / web-framework / prettier-plugin-jte

prettier-plugin-jte

JSON →
library1.2.0jsnpmunverified

A Prettier plugin (v1.2.0) for formatting Java JTE template files. Compatible with Prettier ^3.0.0 and maintained by the JTE community. Supports JTE expressions, directives (@if, @for, @import, @param, @template calls), content blocks, and HTML formatting via Prettier's HTML printer. Actively developed with monthly releases. Differentiates from generic template formatters by understanding JTE-specific syntax and preserving whitespace semantics.

npm install prettier-plugin-jte
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-JT
P
prettier-plugin-jte
web-frameworkjavascriptv1.2.0
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.

plugin (in .prettierrc)
plugins: ['prettier-plugin-jte']
plugins: ['prettier-plugin-jte'] (no require, no import, just string)
Plugins are referenced by package name in Prettier config; no import statement needed.
Default import (for programmatic use)
import plugin from 'prettier-plugin-jte'
const plugin = require('prettier-plugin-jte')
Package is ESM-only; CommonJS require does not work in Node.js with "type": "module".
TypeScript import (type)
import type { Plugin } from 'prettier'
This package provides types but they are re-exported from Prettier; no separate type import needed.

Installs the plugin, adds it to Prettier config, and formats a JTE template file with Prettier.

# Install as a dev dependency npm install --save-dev prettier prettier-plugin-jte # Create or update .prettierrc cat > .prettierrc << 'EOF' { "plugins": ["prettier-plugin-jte"] } EOF # Format a JTE file npx prettier --write "src/main/resources/**/*.jte" # Example input file: src/main/resources/template.jte # @import org.example.Page # @param Page page # # @if(page.getDescription() != null) # <meta name="description" content="${page.getDescription()}"> # @endif # # After formatting, the file gets consistent indentation and spacing.
Debug
Known issues
gotchaPlugin requires Prettier v3 or higher. Using with Prettier v2 will silently fail.
fix
Upgrade Prettier to ^3.0.0: npm install prettier@latest --save-dev
affects: <3.0.0
gotchaThe plugin only supports .jte files – it does not support .kte (Kotlin JTE) syntax.
fix
Use a different formatter for .kte files, or convert to .jte if possible.
affects: all
gotchaExplicit --parser jte flag may be required if Prettier does not auto-detect .jte files.
fix
Run prettier with --parser jte or ensure .prettierrc includes 'overrides': [{'files': '*.jte', 'options': {'parser': 'jte'}}]
affects: all
Errors
Common errors & fixes
Cannot find module 'prettier-plugin-jte'
Plugin not installed or not in node_modules.
fix
Run "npm install --save-dev prettier-plugin-jte" in the project root.
Error: Loading plugin 'prettier-plugin-jte' failed: Cannot find module 'prettier'
Prettier is not installed as a peer dependency.
fix
Run "npm install --save-dev prettier" to install Prettier v3+.
Error: Unsupported parser: "jte"
Prettier version < 3.0.0 does not support custom plugins.
fix
Upgrade Prettier to ^3.0.0.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
prettierrequiredpeer dependency - Prettier must be installed (v3.0.0 or higher)
Agent activity
6 hits · last 30 days
node
6
Resources
prettier-plugin-jte — npm install prettier-plugin-jte · libregistry