-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Running prettier via the pre-commit hook creates invalid mdx #369
Comments
Husky just runs lint-staged which runs prettier. Here's the line in package.json. Looks like prettier might not be that smart in formatting HTML in mdx. Try removing It could also be the case that the current prettier version is slightly outdated and maybe upgrading would fix the issue. Let me know if upgrading prettier helps? |
I created an upstream bug with prettier, until this is fixed I am keeping husky disabled. |
The bug is now tracked in prettier/prettier#12209. I'm closing this issue until the bug is fixed as we can't do anything right now. |
Re-opening the issue for awareness and to avoid similar issues being posted. Have also changed the title to more accurately reflect the bug. If you encounter the issue, currently the best approach would be to exclude md/mdx files from being linted by prettier. You can do that by removing |
by removing `|mdx` from package.json as per advice [here](timlrx/tailwind-nextjs-starter-blog#369 (comment)).
Describe the bug
Running husky creates invalid
mdx
.To Reproduce
Steps to reproduce the behavior:
Press <kbd><kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd></kbd> and
Which generates the following error
Expected behavior
Husky should not generate invalid
mdx
.System Info (if dev / build issue):
Additional context
The problem appears also with other html tags.
A workaround is to disable husky temporarily by renaming the
.husky
folder to something else.According to the mdx playground the markup is really invalid, i.e., it is not a problem with the mdx setup here.
This is probably an upstream bug, but I wanted to report this here as well.
The text was updated successfully, but these errors were encountered: