Search by

parisek / lint-kit

parisek

Twig and PHPStan lint rules for WordPress and Drupal projects: a CMS-neutral core and one opt-in rule set per CMS.

v0.3.0 2026-10-14 12:11 UTC

This package is auto-updated.

Last update: 2026-10-16 17:24:24 UTC


README

Packagist Version PHP CI Twig License: MIT

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 41 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

The package is on Packagist: packagist.org/packages/parisek/lint-kit. A project needs no repositories entry. The release procedure is in RELEASING.md.

composer require --dev "parisek/lint-kit:^0.1"

Develop

composer install
composer test        # PHPUnit: the fixture suite, the preset
composer phpstan

Licence

MIT. See LICENSE.

Related: test-kit, the testing and comparison tool.