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
There are plenty of situations where a developer might have a string containing tailwindcss class names outside of the standard props.
This would allow developers to use a comment to opt-in to sort their strings containing tailwindcss for a given part of the AST, similar to how // prettier-ignore allows developers to opt-out of a given part of the AST.
How?
Functionally
I suspect it would primarily be some modifications in src/parsers/typescript.ts, src/parsers/babel.ts, src/parsers/vue.ts.
I don't really see the need to modify CSS or HTML parsers.
Behaviorally
It should behave similarly to // prettier-ignore.
// prettier-ignore on a new line affects the next item in the AST,
Note they both had incorrect spacing after the assignment operator which both got corrected by prettier, however, only of the strings was corrected by prettier-plugin-tailwind
and // prettier-ignore at the end of a line affects the previous item in the AST,
Same here as above: note they both had incorrect spacing after the assignment operator which both got corrected by prettier, however, only of the strings was corrected by prettier-plugin-tailwind
Additional Details
A consequence of focusing on the AST is being able to define it for a function
Why?
There are plenty of situations where a developer might have a string containing tailwindcss class names outside of the standard props.
This would allow developers to use a comment to opt-in to sort their strings containing tailwindcss for a given part of the AST, similar to how
// prettier-ignore
allows developers to opt-out of a given part of the AST.How?
Functionally
I suspect it would primarily be some modifications in
src/parsers/typescript.ts
,src/parsers/babel.ts
,src/parsers/vue.ts
.I don't really see the need to modify CSS or HTML parsers.
Behaviorally
It should behave similarly to
// prettier-ignore
.// prettier-ignore
on a new line affects the next item in the AST,so for prettier-tailwind it could be like this:
before
after
Note they both had incorrect spacing after the assignment operator which both got corrected by prettier, however, only of the strings was corrected by prettier-plugin-tailwind
and
// prettier-ignore
at the end of a line affects the previous item in the AST,so for prettier-tailwind, it could be like this:
before
after
Same here as above: note they both had incorrect spacing after the assignment operator which both got corrected by prettier, however, only of the strings was corrected by prettier-plugin-tailwind
Additional Details
A consequence of focusing on the AST is being able to define it for a function
before
after
Any guidance on how/where to get started would be appreciated but I'll probably tinker with this at some point for fun anyway.
The text was updated successfully, but these errors were encountered: