You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Vue with the Reactivity Transform macros. There's a $$() macro to keep reactivity of refs when passing them to functions. However this plugin always tries to rename $$() to $(), which leads to Vue throwing an error $ can only be used as the initializer of a variable declaration.
To Reproduce
Create a Vue 3 project. Please install the Reactivity Transform macros if you're using Vue 3.3+, or enable it in config if using Vue 3.2+.
Write a component, and use it in another component. Specify a ref for the component.
I think this issue #276 is related, it's due to the $$ being a special replacement group in a call to "".replace(), which this plugin uses in pre-processing vue code.
I've submitted a fix PR which should address this issue
Your Environment
Describe the bug
I'm using Vue with the Reactivity Transform macros. There's a
$$()
macro to keep reactivity of refs when passing them to functions. However this plugin always tries to rename$$()
to$()
, which leads to Vue throwing an error$ can only be used as the initializer of a variable declaration
.To Reproduce
ref
for the component.$$(componentRef)
is changed to$(componentRef)
.Expected behavior
The
$$()
macros shouldn't be changed.Screenshots, code sample, etc
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
.prettierrc.json
Error log
[plugin:commonjs] $ can only be used as the initializer of a variable declaration
Contribute to @trivago/prettier-plugin-sort-imports
The text was updated successfully, but these errors were encountered: