lintkit / typo3-mago-config
Liquid Light base configuration for Mago in TYPO3 projects
Requires
- carthage-software/mago: ^1.51.1
- typo3/testing-framework: ^8.0 || ^9.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
- lintkit/mago-config: 2.0.0
This package is auto-updated.
Last update: 2026-11-05 14:22:04 UTC
README
Liquid Light base configuration for Mago - the PHP formatter, linter and analyzer - in TYPO3 projects
Usage
Install the dependency:
composer require --dev lintkit/typo3-mago-config
This also installs typo3/testing-framework.
Add the scripts:
"scripts": { "mago": "mago --config vendor/lintkit/typo3-mago-config/.mago.toml", "mago:analyze": "@mago analyze", "mago:dry-run": "@mago:fix --check", "mago:fix": "@mago fmt", "mago:lint": "@mago lint" },
PHP version
Mago targets PHP 8.4 by default. If the project sets config.platform.php, pass that version to Mago instead:
"mago": "MAGO_PHP_VERSION=$(composer config platform.php) mago --config vendor/lintkit/typo3-mago-config/.mago.toml",
TYPO3
The config makes allowances for TYPO3:
- TYPO3 core,
config/system/settings.phpand projectbackup/andhtml/directories are not checked $GLOBALSis allowed in TCA,ext_localconf.php,ext_tables.phpandconfig/system/*.php- Extbase models may have many properties and methods
- Exception codes (timestamps) don't need numeric separators
ext_emconf.phpdoesn't needdeclare(strict_types=1)- The
defined('TYPO3') || die();guard is not reported as an unused statement
Baselines
The linter and analyzer read their baselines from a .mago/ directory in the project root. If these don't exist, Mago warns and reports every issue.
Generate them with:
mkdir -p .mago composer mago:lint -- --generate-baseline composer mago:analyze -- --generate-baseline
Commit the .mago/ directory.
Upgrading from lintkit/mago-config
This package replaces lintkit/mago-config, and the TYPO3 rules are now in .mago.toml itself.
-
Swap the package:
composer remove --dev lintkit/mago-config composer require --dev lintkit/typo3-mago-config
-
Change the
magoscript's config path, whether it pointed at.mago.tomlor.typo3.mago.toml, tovendor/lintkit/typo3-mago-config/.mago.toml