curlylint
curlylint copied to clipboard
Support Alpine.js syntax
I have Django templates I would like to lint, but cannot because they incorporate Alpine.js events.
The linter is throwing a parse error, because it doesn't support attributes starting with @
, which Alpine.js uses for events like @click
. To support Alpine.js, html attributes starting with @ would have to be recognized as valid.
Currently facing the same problem. The following code throws an error when running curlylint.
Code:
<div class="ml-auto pl-3"> <div class="-mx-1.5 -my-1.5"> <button type="button" class="inline-flex rounded-md bg-green-50 p-1.5 text-green-500 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50" @click="dismiss = true"> <span class="sr-only">Dismiss</span> <!-- Heroicon name: mini/x-mark --> <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> <path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"></path> </svg> </button> </div> </div>
Error: 117:38 Parse error: expected one of '>', 'attribute', '{#', '{%', '{{' at 117:38 parse_error Oh no! 💥 💔 💥 1 error reported
Please let me know, if there are more informations needed to reproduce the error.