-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Bug: pugClassNotation: 'attribute' outputs junk if class literals are after attributes #508
Open
1 of 7 tasks
Comments
Is this a duplicate of #167? |
You could either extend the tests in https://github.com/prettier/plugin-pug/tree/main/tests/options/pugClassNotation or add a new test in https://github.com/prettier/plugin-pug/tree/main/tests/issues in a new folder issue-508 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Plugin Version
3.1.0
Prettier Version
3.3.3
Which frameworks are affected?
Node Version
20.17.0
Which operating systems have you used?
Prettier config
{ pugClassNotation: 'attribute' }
Input
Output or Error
Expected Output
Additional Context
My workaround for this issue was to first use the option that refactors all class literals to the beginning and only then enable this class attribute option.
This is easy to repro by expanding the
pugClassNotation
test with the above code.The offending code is easy to spot at the beginning of the private
class
function inprinter.ts,
but it's not immediately clear to me why that code works in the first place (do multiple chained attributes get merged by some follow-up logic?) or how to fix it properly. I'll open a PR if I can puzzle it out 🤷♂️My verbosely commented version of the code that needs fixing:
The text was updated successfully, but these errors were encountered: