fortephp / sheath-super-native
Sheath rules for NativePHP Mobile Blade views: native element, class, and idiom linting for super native templates.
Fund package maintenance!
Requires
- php: ^8.4
- fortephp/sheath: ^1.0
Requires (Dev)
- laravel/pint: ^1.22
- nativephp/mobile: ^4.2
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^3
- phpstan/phpstan: ^2.1
- rector/rector: ^2.6
Suggests
- nativephp/mobile: The compiler these rules lint for. When installed, class and element tables are reflected from it instead of the bundled snapshot.
README
Catch mistakes in NativePHP SuperNative Blade views before they reach a device.
This Sheath plugin understands native elements, event and model bindings, NativePHP's Tailwind subset, layout rules, themes, and accessibility conventions. It reports problems directly in your Blade views without rendering a screen or launching an app.
Installation
composer require --dev fortephp/sheath-super-native
Laravel discovers the package automatically. If your application does not have a Sheath config yet, publish it:
php artisan vendor:publish --tag=sheath-config
Then add the nativephp preset to config/sheath.php:
'preset' => ['recommended', 'nativephp'],
Keep nativephp after the built-in presets. Later presets win, and this ordering prevents web-focused HTML rules from reporting native markup.
Run Sheath normally:
php artisan sheath:lint
You can also try the plugin without changing your config:
php artisan sheath:lint --preset=nativephp
Usage
Sheath scans its configured view paths by default. You can also lint a directory or one file:
php artisan sheath:lint resources/views/native php artisan sheath:lint resources/views/native/home.blade.php
Some spelling mistakes have safe fixes:
php artisan sheath:lint --fix
Use php artisan sheath:lint --print-config to see every active rule and severity.
What it catches
- unknown, incomplete, or unbalanced native elements;
- discarded HTML, unsupported attributes, invalid enum values, and malformed line points;
- unsupported events, missing callbacks, invalid navigation transitions, and callback argument mismatches;
- model bindings on the wrong element or properties that are missing, private, readonly, or locked;
- missing, duplicate, constant, or position-based keys in repeated content;
- unsupported Tailwind utilities and classes that NativePHP interprets differently than written;
- incomplete borders, ignored dark variants, invalid glass modifiers, and misplaced text styles;
- invalid native layout structure, duplicate safe-area padding, undefined theme tokens, and unnamed icon controls.
Diagnostics point to the authored Blade element rather than generated compiler output, so the problem is easier to find and fix.
The plugin reads registered SuperNative elements, components, attributes, events, and theme behavior from the installed NativePHP runtime. Plugin-provided features are recognized automatically, while dynamic behavior the linter cannot verify is left alone instead of guessed at.
Configuration
You can override individual rules in config/sheath.php:
'rules' => [ 'native-no-emoji' => 'off', 'native-prefer-theme-tokens' => 'off', 'native-key-hygiene' => 'error', ],
Native rules target resources/views/native by default and also recognize views containing unmistakable SuperNative tags. If your native views live elsewhere, pass a nativeViewPaths option to the native rules you enable. Configuring explicit paths switches detection to path-only, which is useful when web components share names with native elements.
Requirements
- PHP 8.4 or newer
- Laravel 12 or 13
- NativePHP Mobile 4.2 or newer within the 4.x series (SuperNative)
- Sheath 1.x
License
MIT. See license.md.