Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>twig-to-jsxNew to Visual Studio Code? Get it now.
twig-to-jsx

twig-to-jsx

Alexandre Poirier

|
3,543 installs
| (0) | Free
Helps with the conversion of a twig file into a jsx syntax.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

twig-to-jsx

Converts a twig file into a jsx-ready syntax.

Currently this is using some personalized twig tags and is very much a work in progress so use at your own risk. I hope to add support for custom twig tags soon.

Usage

In the command tool (ctrl + shift + p), type Twig-to-jsx and choose your method of conversion. (The current file option was only tested on twig file, use at your own risks on other extensions)

Requirements

jsx-control-statements (https://www.npmjs.com/package/jsx-control-statements)

In order to keep the file structure as close to the original as possible, any control statement will be converted using the above npm package's syntax.

Known Issues

  • Some app specific codes are still to be removed
  • onClick functions should convert to an anonymous function () => {[CODE HERE]}
  • The style tag should convert to a style object

Release Notes

1.2.0

  • Add support for the 'include' tag
  • Rework code for more extensibility

1.1.0

  • Add support for selection conversion

1.0.0

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