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
fix(variant-group)!: remove quotes matching, add option to config seperator #1231
Conversation
✅ Deploy Preview for unocss canceled.
|
const file = await readFile('./test/assets/variant-group.vue', 'utf-8') | ||
const result = await transform(file) | ||
expect(result).toMatchInlineSnapshot(` | ||
"<script setup lang=\\"ts\\"> | ||
const a = 1 | ||
const b = 2 | ||
// eslint-disable-next-line @typescript-eslint/space-infix-ops | ||
const c = a-(b -a -b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this one is a JS that should not be transformed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but there is no good way to solve this problem.
I think this is a very rare case where no one would write arithmetic this way, and we can either wait for this problem to appear and then solve it, or provide an option to disable the -
transform.
I do like the improvement of magic string tho |
fix: #1215
revert #831 (Matching the content of quotes can get very complicated)
And Fix the problem that repeated use of MagicString.replace does not work. refer Rich-Harris/magic-string#208