curlylint icon indicating copy to clipboard operation
curlylint copied to clipboard

Support Alpine.js syntax

Open Alex3917 opened this issue 2 years ago • 1 comments

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.

Alex3917 avatar Sep 23 '22 19:09 Alex3917

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.

jkaeske avatar Feb 23 '23 19:02 jkaeske