Handle singleQuote option more precisely#312
Conversation
|
closes #45 |
Shinigami92
left a comment
There was a problem hiding this comment.
I will look into other changes later, I'm currently just on mobile.
Shinigami92
left a comment
There was a problem hiding this comment.
Please revert pnpm-lock.yaml. It's unrelated to the PR
Shinigami92
left a comment
There was a problem hiding this comment.
I think you should hugely enhance / extends the tests/options/singleQuote/single-quote.test.ts test cases. IMO the expected and code are not sufficient anymore now.
|
this is probably a pretty good start on this. there are still some issues that are related to pug-lexer and the way certain tokens are handled but I would say outside of the scope of this PR. Eventually I will try to circle back around to fix those up. Ideally if I say |
|
I would really like that you extend the code fragments in |
|
Will look into it tomorrow |
Shinigami92
left a comment
There was a problem hiding this comment.
I only have two more requests 🙂 Then I will merge it
- You are allowed to remove
tests/options/singleQuote/single-quote.test.tsdue to it is covered by your new tests 🎉 - Please add in each of these
tests/options/singleQuote/**/*.pugfiles a normal attribute to a pug token.
So e.g.div(:class='{ "pt-2": !dense }')becomesdiv(:class='{ "pt-2": !dense }', test='test')
Best would be that in the unformatted file always wrong quote/format version is present, so it does explicitly get formatted by the test case
This will help that no regression will happen there in the future
This should now have code interpolation be using the pugSingleQuote unless it is inside of quotes.