PHPackages                             acalvino4/craft-twig-ruleset - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. acalvino4/craft-twig-ruleset

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

acalvino4/craft-twig-ruleset
============================

A twig coding style ruleset for the Craft community

1.0.3(3y ago)131MITPHP

Since Apr 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/acalvino4/craft-twigruleset)[ Packagist](https://packagist.org/packages/acalvino4/craft-twig-ruleset)[ Docs](https://github.com/acalvino4/craft-twigruleset)[ RSS](/packages/acalvino4-craft-twig-ruleset/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Craft Twig Ruleset
==================

[](#craft-twig-ruleset)

In the effort to automate as much style checking as possible, twig files would ideally not be missed in a Craft CMS project.

There is a [good package](https://github.com/friendsoftwig/twigcs) for this, but it misses Craft conventions on a couple points.

- camelCase variable names, instead of snake\_case
- use of the fairly ubiquitous [empty coalesce operator](https://plugins.craftcms.com/empty-coalesce) from Andrew Welch

The ruleset provided here maintains the official ruleset, with the exception of addressing the two issues above. I am happy to consider further modifications requests / PR's if it can be demonstrated that they would be warranted by the Craft community.

Usage
-----

[](#usage)

### Install

[](#install)

`composer require --dev acalvino4/craft-twig-ruleset`

### Configure

[](#configure)

```
