Sheath for VS Code
Catch broken Blade templates in your editor.
Sheath is a Laravel-first linter for Blade and HTML. It catches accessibility, security, Blade, SEO, performance, and markup problems before they reach review or production. This extension adds those findings to VS Code without replacing diagnostics from PHP, Blade, or other extensions.
What it does
- Reports problems in the editor and VS Code's Problems panel.
- Checks unsaved Blade content after a short debounce.
- Scans the workspace on startup so unopened templates are covered too.
- Reuses a background Artisan process for responsive feedback.
- Finds PHP through Laravel-aware environments including Herd, Valet, Sail, Lando, and DDEV.
- Runs only in trusted workspaces and sends no source code or telemetry anywhere.
Requirements
- VS Code 1.85 or newer.
- A Laravel application with an
artisan file.
- PHP 8.2 or newer, either locally or through a supported Laravel environment.
fortephp/sheath 1.x installed in the application.
Install Sheath from the Laravel project root:
composer require --dev fortephp/sheath
Sheath uses the recommended preset and checks resources/views by default. See the Sheath documentation for rules, presets, configuration, suppressions, baselines, and fixes.
Installation
Install Sheath from the VS Code Marketplace, open the Laravel project, and trust the workspace when VS Code asks. Diagnostics begin automatically.
To try a locally built release instead, open the Extensions view, choose Install from VSIX..., and select the generated .vsix file.
Using the extension
The extension lints Blade files as they change and as they are saved. These commands are also available from the Command Palette:
- Sheath: Lint Current File refreshes the active Blade template.
- Sheath: Lint Workspace refreshes every configured Blade template.
- Sheath: Show Output opens the diagnostic log for troubleshooting.
Whole-project scans use up to eight workers when Sheath's optional parallel runtime is installed. They fall back to sequential linting automatically when it is not.
PHP environments
Automatic detection follows the official Laravel extension's environment order: Herd, Valet, Sail, Lando, DDEV, and then local PHP. On Windows, local PHP is checked first so detection does not wait for a desktop environment that is not running.
Set sheath.phpCommand when the project needs a custom executable or command template. Put {code} where the Artisan path belongs:
{
"sheath.phpCommand": "docker exec -i my-app php {code}"
}
If sheath.phpCommand is empty, an explicit Laravel.phpCommand from the official Laravel extension is honored before automatic detection.
Settings
| Setting |
Default |
Purpose |
sheath.enabled |
true |
Enables Blade diagnostics. |
sheath.runOnStartup |
true |
Scans the Laravel workspace after activation. |
sheath.lintOnChange |
true |
Checks unsaved edits. |
sheath.lintOnSave |
true |
Checks a Blade file after save. |
sheath.debounceMilliseconds |
400 |
Wait time after an edit before linting. |
sheath.timeoutMilliseconds |
60000 |
Maximum duration of one Sheath request. |
sheath.projectScanProcesses |
8 |
Maximum parallel processes for workspace scans; use 1 for sequential scans. |
sheath.phpCommand |
empty |
Custom PHP executable or command template. |
Settings can be applied per workspace folder, which is useful for monorepos with different PHP environments.
Troubleshooting
Run php artisan sheath:lint in the Laravel project first. If that succeeds but editor diagnostics do not appear:
- Confirm the workspace is trusted and the file ends in
.blade.php.
- Run Sheath: Show Output and check which PHP environment was selected.
- Set
sheath.phpCommand if automatic PHP detection does not match the project.
- Run Sheath: Lint Current File to retry immediately after a failure.
Remote and container workspaces are supported when the extension runs on the workspace side and PHP is available there. Virtual workspaces are not supported because Sheath must execute the Laravel application's Artisan entry point.
Development
Development requires Node.js 20 or newer, npm, and PHP for the Extension Host integration test.
npm ci
npm run format:check
npm run test:unit
npm run test:integration
npm run test:integration:minimum
npm run package
Open this directory in VS Code and press F5 to compile the extension and launch an Extension Development Host against the trusted test fixture. The integration test downloads a test copy of VS Code on its first run.
See CONTRIBUTING.md for the code layout and contribution workflow.
License
Sheath for VS Code is open-source software licensed under the MIT license.