Problem/Motivation
We are using PHP_CodeSniffer for PHP coding standards, ESLint for JavaScript and Stylelint for CSS, but we have nothing for Twig templates.
Steps to reproduce
Proposed resolution
Adopt https://github.com/VincentLanglet/Twig-CS-Fixer for ensuring Twig templates match coding standards.
Dependency evaluation
Maintainership: Primary author is Vincent Langlet, also very active in other projects around Symfony (Symfony itself, Sonata, Doctrine). The author is responsive to issues and pull requests. Only 3 issues are open (2024-07-12), all of them were opened within the last three months.
Security policy: See https://github.com/VincentLanglet/Twig-CS-Fixer/security/policy The latest major version is maintained and receives security updates, which should be fine for a dev dependency.
Release cycle: Frequent releases, 19 so far this year. Version 2.0.0 (current major version) has been released at the end of 2023. The maintainer confirmed that he tries to adhere to semver.
Other dependencies: None that aren't already required by Drupal itself or other dependencies.
Remaining tasks
- Add TwigCS to composer.json and commit-code-check.sh
- Configure it to pass without any violations for now
- Raise child issues to fix individual violations