PBHJ Advanced Formatter · VS Code Extension

Advanced, fast, and reliable formatting for web and PHP

PBHJ Advanced Formatter brings consistent formatting for HTML, JavaScript, PHP, and Blade (.blade.php) right inside VS Code.

HTML JavaScript PHP Blade

Quick install

  1. Open VS Code
  2. Press Ctrl+P
  3. Paste the command below and press Enter
Requires VS Code 1.70.0 or newer.

Features

HTML & JavaScript via Prettier

Battle‑tested Prettier formatting for HTML and JavaScript.

PHP via @prettier/plugin-php

Consistent PHP formatting powered by the official Prettier PHP plugin.

Blade via blade-formatter

Purpose‑built Blade formatter designed for Laravel’s templating syntax.

One‑click or on‑save

Run the command or enable editor.formatOnSave to format automatically.

Usage

Command

  • PBHJ: Format Document – format the active file

Shortcut: Shift+Alt+P

Auto‑format: enable "editor.formatOnSave": true in settings.

How it works

  • HTML, JavaScript → prettier
  • PHP → @prettier/plugin-php
  • Blade → blade-formatter

Settings

Key Default Description
pbhjFormatter.printWidth 100 Maximum line width for Prettier‑based formatters.
pbhjFormatter.tabWidth 2 Spaces per indentation level.
pbhjFormatter.useTabs false Use tabs instead of spaces.
pbhjFormatter.semi true Print semicolons in JavaScript.
pbhjFormatter.singleQuote true Use single quotes in JavaScript.
pbhjFormatter.blade.wrapAttributes "auto" Attribute wrapping for Blade (auto, force, force-aligned, force-expand-multiline).

Compatibility

  • VS Code ≥ 1.70.0
  • Works with .html, .js, .php, .blade.php

Troubleshooting

Formatting doesn’t run on save

  • Ensure "editor.formatOnSave": true is enabled.
  • Make sure this extension is the default formatter for the file type.

Unexpected result in Blade

  • Adjust pbhjFormatter.blade.wrapAttributes to your preferred style.
  • Reload the window after changing settings.

FAQ

Yes, it uses prettier, @prettier/plugin-php, and blade-formatter and respects your configuration above.

.html, .htm, .js, .mjs, .cjs, .php, and .blade.php.

Run the command palette and execute PBHJ: Format Document or press Shift+Alt+P.

Ready to format with confidence?

Install the extension and keep your codebase consistent across HTML, JS, PHP, and Blade.

Open in VS Code Marketplace