Skip to content
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

Prettier on save output is different from running format:write for tailwind classes #54

Closed
ahkhanjani opened this issue Nov 11, 2024 · 2 comments

Comments

@ahkhanjani
Copy link
Contributor

ahkhanjani commented Nov 11, 2024

I only tried for MDX files but the title says everything. This is for this repo itself not the component.

@omeralpi
Copy link
Owner

Hi,
I've noticed that Prettier and VSCode behave differently with MDX formatted files.
Fixes #55. Could you test this PR? I believe this will resolve the issue.

@ahkhanjani
Copy link
Contributor Author

I've noticed that Prettier and VSCode behave differently with MDX formatted files.

Hi. I found an issue confirming this.

Running pnpm format gave me a different output for both mdx and jsx files. I figured out that eslint tailwind plugin has different sorting preferences than the prettier plugin. So lint --fix was reordering classes that prettier was already fixing with format in a different way. Turning off the class order rule fixed the issue for jsx files.

mdx still gives a different output on save. Not sure what we can do about it.

I'll make a PR to this branch with my results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants