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
Is your feature request related to a problem? Please describe
In Vue JSX, if class appears on multiple lines without using backticks, a module resolution error will occur, and now I have to manually replace double quotes with backticks.
constCallout=({ children })=>{return(<divclass="rounded-xl border border-zinc-400/30 bg-gray-100/50 px-4 py-4 dark:border-neutral-500/30 dark:bg-neutral-900/50">{children}</div>);};
Module parse failed: Unterminated string constant (629:15)
File was processed with these loaders:
* ./node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| var children = _ref5.children;
| return h("div", {
> "class": "rounded-xl border border-zinc-400/30 bg-gray-100/50 px-4 py-4 dark:border-neutral-500/30
| dark:bg-neutral-900/50"
| }, [children]);
Describe the solution you'd like
Add a jsxBackquote option to automatically replace quotes with backticks when line breaks occur in attributes such as class, className.
constCallout=({ children })=>{return(<divclass="rounded-xl border border-zinc-400/30 bg-gray-100/50 px-4 py-4 dark:border-neutral-500/30 dark:bg-neutral-900/50">{children}</div>);};// ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ to this ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓constCallout=({ children })=>{return(<divclass={`rounded-xl border border-zinc-400/30 bg-gray-100/50 px-4 py-4 dark:border-neutral-500/30 dark:bg-neutral-900/50`}>{children}</div>);};
Describe alternatives you've considered
A more advanced use case, automatically wrap the class content with libraries such as clsx, twMerge when there are multiple lines (but it may exceed the scope of this library).
constCallout=({ children })=>{return(<divclass={twMerge(['rounded-xl border border-zinc-400/30 bg-gray-100/50 px-4 py-4 dark:border-neutral-500/30 dark:bg-neutral-900/50',])}>{children}</div>);};
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe
In Vue JSX, if
class
appears on multiple lines without using backticks, a module resolution error will occur, and now I have to manually replace double quotes with backticks.Describe the solution you'd like
Add a
jsxBackquote
option to automatically replace quotes with backticks when line breaks occur in attributes such asclass
,className
.Describe alternatives you've considered
A more advanced use case, automatically wrap the
class
content with libraries such asclsx
,twMerge
when there are multiple lines (but it may exceed the scope of this library).The text was updated successfully, but these errors were encountered: