This linter plugin for Visual Studio Code provides an interface to twigcs. It will be used with files that have the “Twig” language mode.
Visual Studio Code must be installed in order to use this plugin. If Visual Studio Code is not installed, please follow the instructions here.
Before using this plugin, you must ensure that twigcs is installed on your system. The installation can be performed system-wide / project-wide using composer.
Once twigcs is installed, you can proceed to install the vscode-twigcs plugin if it is not yet installed.
twigcs linter can be installed globally using the Composer Dependency Manager for PHP.
twigcs package by typing the following in a terminal:
composer global require allocine/twigcs
twigcs linter can be installed in your project using the Composer Dependency Manager for PHP.
twigcs package by typing the following at the root of your project in a terminal:
composer require --dev allocine/twigcs
- Open Visual Studio Code.
Ctrl+P on Windows or
Cmd+P on Mac to open the Quick Open dialog.
- Type ext install twigcs to find the extension.
- Press Enter or click the cloud icon to install it.
- Restart Visual Studio Code when prompted.
This extension contributes the following variables to the settings :
||If true, will activate the twig linter extension.
||If true, will activate twig warnings.
||Controls the executable path for the
The extension architecture is based off of the Language Server Node Example and phpcs Code Sniffer.
Contributing and Licensing
The project is hosted on GitHub where you can report issues, fork the project and submit pull requests.
The project is available under MIT license, which allows modification and redistribution for both commercial and non-commercial purposes.