sserbin / twig-linter Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I'm using this package in a package of my own and I'm running into issues with installing on PHP 8.0.
This package requires ocramius/package-versions
^1.3, which resolves to at most an 1.11 version with maximum PHP 7.4 support.
But because this package also requires for dev psalm, which in turn requires composer/package-versions-deprecated
, the testsuite runs OK. composer/package-versions-deprecated
is compatible fork that defines a replace for ocramius/package-versions
and it's 1.11 versions do support PHP 8.0.
Hi @sserbin,
I know this might be a spam issue, however, I would like to contribute some more changes to this project for my hacktoberfest goal. However, this year the rules are changed and maintainers must enlist their repositories manually.
Would you be so kind doing so before Oct 30th? The repository should have a hacktoberfest
topic as per the instructions on https://hacktoberfest.digitalocean.com/hacktoberfest-update
Sorry again, and thanks in advance!
When linting the following code (Twig 2), the linter complains with the message Unknown "trans" tag
.
{% trans %}
Hello!
{% endtrans %}
Thanks!
With the release of V1.0.3 customs functions are now validated. We get the following output:
8 'someObjectKey': 'sometext',
9 'icon': svg('pictogram', 'test'),
>> 10 'label': t('test'),
>> Unknown "t" function. Did you mean "date", "constant"?
while the svg()
function is skipped correctly, it doesn't get happy with t
We tried running your twig linter over our twig 2 codebase, there where some peculiar things and would like to discuss why this happens and the possibility to change this.
The first thing is that these notations are not supported:
same as(SOMEVAR)
-> should be sameas(SOMEVAR)
. We would like to keep this with space.divisible by(2)
-> should be divisibleby(2)
. Again, we would like to keep this with a space.Also we have some custom funcitons in our environment, it is okay that these wont be linted, but after adjusting the codebase to the above "issues" we still have 2 errors left:
ERROR in {SOMEFILE}.twig (line 49)
47 {HTML HERE}
48 {HTML HERE}
>> 49 {{ getCurrencySymbol() }}
>> Value for argument "_" is required for function "getCurrencySymbol".
50 {{ {HTML CUSTOM FUNCTIONS WITH ARGS HERE} }}
51 {HTML HERE}
Not sure why the linter gets confused on this
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.