Download the PHP package sitegeist/fluid-components-linter without Composer
On this page you can find all versions of the php package sitegeist/fluid-components-linter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sitegeist/fluid-components-linter
More information about sitegeist/fluid-components-linter
Files in sitegeist/fluid-components-linter
Package fluid-components-linter
Short Description Tool to validate fluid components based on a specified ruleset
License MIT
Homepage https://github.com/sitegeist/fluid-components-linter
Informations about the package fluid-components-linter
Fluid Components Linter
CLI tool to validate your Fluid Components based on a specific ruleset for code quality.
Features
- check basic Fluid syntax
- check correct component structure (e. g. correct nesting of component ViewHelpers)
- enforce naming scheme and min/max length of parameter names
- limit parameter count per component (which should lead to simpler components)
- enforce parameter descriptions
- enforce presence of markdown documentation and fixture files used by Fluid Styleguide
- normalize syntax of namespaces in parameter type
- encourage strict data types instead of generic
array
orobject
- suggest usage of correct types if parameter names contain hints like
link
orimage
- enforce that component prefixer and
class
param are used - enforce that certain ViewHelpers can't be used inside components
- enforce that
content
param is always wrapped in<f:format.raw>
Getting Started
To use the linter, require this package as a dev dependency via composer:
composer req --dev sitegeist/fluid-components-linter
The package provides the binary fclint
which can be used to validate
individual component files as well as whole directory structures containing
component files.
fclint lint Resources/Private/Components/
For ease of use you might want to define a custom composer command in your project:
composer.json:
and then just call:
composer lint:components
(on-demand, in git hooks, in your CI...)
Customize Ruleset
If you want to modify the code quality ruleset, you can overwrite the predefined rules in default.fclint.json:
fclint lint -c ./myRules.fclint.json Resources/Private/Components/
For convenience, a file named .fclint.json
in the current working directory will be picked
up automatically and doesn't need to be specified with -c
.
Your adjusted configuration will be merged with the selected configuration preset, so you only need to specify the rules you want to change. To make the following changes to the default rules:
- ignore all components inside a folder called
Template/
- don't require a markdown documentation file if a fixture file is present
- limit length of parameter names to 30 characters (default is 40)
you would use the following configuration file:
.fclint.json:
Command Line Options
There are a few command line options that can be specified:
Support & Discussion
If you have any questions, need support or want to discuss components in TYPO3, feel free to join #ext-fluid_components.
All versions of fluid-components-linter with dependencies
symfony/config Version ^5.0 || ^6.0 || ^7.0
symfony/console Version ^5.0 || ^6.0 || ^7.0
typo3fluid/fluid Version ^4.0 || ^2.6