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.

Package info

github.com/parisek/lint-kit

pkg:composer/parisek/lint-kit

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

v0.2.0 2026-10-08 11:19 UTC

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

Licence

MIT. See LICENSE.

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