-
Notifications
You must be signed in to change notification settings - Fork 25
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
Curlylint complains about split anchor tags introduces by Prettier #16
Comments
Hey @bazzadp, thanks for the report. I wouldn’t be surprised if the parser was overly strict in that respect, having had to fix issues with it failing to parse self-closing SVG tags (#4), or uppercase HTML tags. If you’re keen to look into this I think the fix would likely be to allow whitespace for all of the cases in Lines 693 to 699 in 35a1412
Looking at the potential implementation, there might be a fair bit of duplication, since parsing for all of those different types of tags is separated out. In the meantime, it might help to set Prettier to Can I ask what language or Prettier plugin you’re using for your templates? I think I ran into this issue before but didn’t really make much of it since Prettier doesn’t support the template syntax of Jinja / Django Templates I most commonly work with. |
Finally spending time to look into this further, the issue is here: Line 450 in c144fc6
This assumes the tag name on closing tags is directly followed with -P.string("</").then(tag_name_parser).skip(P.string(">"))
+P.string("</").then(tag_name_parser).skip(whitespace + P.string(">")) However I’m a bit hesitant to make parser changes like this until there is a better test suite in place. Any help towards this would be much appreciated! |
Upvote for this from me. Is there a way to tell curly to ignore these types of errors in the meantime?
|
Describe the bug
Prettier sometimes splits lines like this:
Into this:
This is valid HTML, even if it looks a little weird. It's done because white space in between elements can mean something whereas whitespace in elements is safe.
Curlylint does not recognise this as valid and complains.
Which terms did you search for in the documentation and issue tracker?
prettier
Environment
Curlylint 0.12.0
Steps to reproduce
test.html
file with the contents of the split line:Expected behavior
File should pass linting
Actual behavior
Removing the newline resolves the error and file lints correctly.
Reproducible demo
Given above
The text was updated successfully, but these errors were encountered: