parisek / lint-kit
Twig and PHPStan lint rules for WordPress and Drupal projects: a CMS-neutral core and one opt-in rule set per CMS.
v0.2.0
2026-10-08 11:19 UTC
Requires
- php: >=8.3
- symfony/yaml: ^6.4 || ^7.0 || ^8.0
- twig/twig: ^3.30
- vincentlanglet/twig-cs-fixer: ^4.1.1
Requires (Dev)
- ergebnis/composer-normalize: ^2.54
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^11.0 || ^12.0
Suggests
- phpstan/extension-installer: Loads the PHPStan rules of this package without a manual include.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-08 11:20:17 UTC
README
Status: alpha. The Twig rules are in. The PHPStan rules follow.
One Composer package for the Twig and PHPStan lint rules, shared by WordPress and Drupal projects: a CMS-neutral core and one opt-in rule set per CMS.
| Set | Twig rules | PHPStan rules |
|---|---|---|
core |
40 | 0 |
wordpress |
0 (adds the site root) |
planned (7) |
drupal |
0 (empty today) | 0 |
Use
A project config is a few lines. It replaces a hand-kept list of require_once and addRule() calls.
// twig-cs-fixer.php return \Parisek\LintKit\Twig\Preset::config([ 'templates' => [__DIR__ . '/templates'], 'sets' => ['core', 'wordpress'], // 'core' alone is the default 'themeName' => 'my-theme', // the text domain; turns on TranslationThemeNameRule ]);
vendor/bin/twig-cs-fixer lint --config twig-cs-fixer.php
The options are listed in src/Twig/Preset.php.
Install
After the first tag and the Packagist submission (see RELEASING.md):
composer require --dev "parisek/lint-kit:^0.1"
Develop
composer install composer test # PHPUnit: the fixture suite, the preset composer phpstan
- Plan and requirements: portadesign/tailwind-base#874 (private repository).
- Decision record:
docs/adr/. - Fixtures:
tests/Fixtures/README.md.
Licence
MIT. See LICENSE.
Related: test-kit, the testing and comparison tool.