Standalone twig linter.

1.0.2 2016-07-25 21:02 UTC

This package is not auto-updated.

Last update: 2022-05-21 21:28:46 UTC


twig-lint is a lint tool for your twig files.

It can be useful to integrate in your ci setup or as the basis of editor plugins (e.g. syntastic for Vim).

Build Status

Installation / Usage

As standalone executable

Download the twig-linter.phar executable. Or as a global composer dependency:

composer global require "xvilo/twig-lint" "@stable"

Run php twig-linter.phar lint <file> or ~/.composer/vendor/bin/twig-linter lint <file>.

As a dev dependency

Add the following to your composer.json:

    "require-dev": {
        "xvilo/twig-lint": "*"

Run ./bin/twig-linter lint <file>.

Vim and Syntastic configuration

For the standalone executable, add the following to your ~/.vimrc file:

let g:syntastic_twig_twiglint_exec = 'php'
let g:syntastic_twig_twiglint_exe = 'php /path/to/twig-linter.phar'

For the composer dependency, twig-lint must be in your $PATH, no further configuration is needed.


Alexander iam.asm89@gmail.com
Marc Weistroff marc.weistroff@sensiolabs.com (creator of the original twig:lint command in the symfony framework)


  • twig-lint is licensed under the MIT License - see the LICENSE file for details
  • I am providing code in this repository to you under an open source license. Because this is my personal repository, the license you receive to my code is from me and not from my employer (Facebook).