Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Twigcs LinterNew to Visual Studio Code? Get it now.
Twigcs Linter

Twigcs Linter

Cerzat43

|
21,306 installs
| (5) | Free
Twig CodeSniffer for Visual Studio Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-twigcs

Current Version Install Count Open Issues

This linter plugin for Visual Studio Code provides an interface to twigcs. It will be used with files that have the “Twig” language mode.

Twigcs example

Installation

Visual Studio Code must be installed in order to use this plugin. If Visual Studio Code is not installed, please follow the instructions here.

Linter Installation

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.

System-wide Installation

The twigcs linter can be installed globally using the Composer Dependency Manager for PHP.

  1. Install composer.
  2. Require twigcs package by typing the following in a terminal:
composer global require friendsoftwig/twigcs

Project-wide Installation

The twigcs linter can be installed in your project using the Composer Dependency Manager for PHP.

  1. Install composer.
  2. Require twigcs package by typing the following at the root of your project in a terminal:
composer require --dev friendsoftwig/twigcs

Plugin Installation

  1. Open Visual Studio Code.
  2. Press Ctrl+P on Windows or Cmd+P on Mac to open the Quick Open dialog.
  3. Type ext install twigcs to find the extension.
  4. Press Enter or click the cloud icon to install it.
  5. Restart Visual Studio Code when prompted.

Settings

This extension contributes the following variables to the settings :

Name Default Description
twigcs.enabled true If true, will activate the twig linter extension.
twigcs.enabledWarning true If true, will activate twig warnings.
twigcs.executablePath null Controls the executable path for the twigcs.
twigcs.rulesetClass null Controls the custom ruleset class. The \ character must be escaped Ex: \\twigcs\\MyRuleset

Acknowledgements

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.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft