Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Allow registering custom Twig tests expression #117

Merged
merged 2 commits into from
Feb 1, 2025

Conversation

aarongerig
Copy link

This PR adds the new config option twigTestExpressions, which allows the user to register any custom Twig tests. This makes those custom tests known to the parser without throwing any errors.

@zackad I tried to add the functionality with the best of my knowledge on how to integrate something like that in a Prettier plugin, like this one. I hope we can work with that and I'm always very grateful for inputs. Let me know, if I can do something differently to refactor this implementation.

@zackad zackad changed the title [WIP] Register custom Twig tests [WIP] Feature: Register custom Twig tests Jan 23, 2025
@aarongerig
Copy link
Author

@zackad Btw, I will add documentation for the new option, once I'm done with the coding.

@zackad zackad changed the title [WIP] Feature: Register custom Twig tests Feature: Allow registering custom Twig tests expression Jan 30, 2025
@zackad zackad added Enhancement New feature or request Parser Logic related on how to parse twig template labels Jan 30, 2025
@zackad zackad force-pushed the feat/custom-test-expressions branch from 17a2556 to 555602f Compare February 1, 2025 04:18
@zackad zackad merged commit 02b752c into zackad:master Feb 1, 2025
3 checks passed
@zackad
Copy link
Owner

zackad commented Feb 1, 2025

thanks @aarongerig

@aarongerig aarongerig deleted the feat/custom-test-expressions branch February 2, 2025 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Parser Logic related on how to parse twig template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants