-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Is there a way to preserve the file as-is and do not autoformat at all? #643
Comments
In this release, you can leverage ignore comments:
|
@panoply thanks for your answer! this seems to get closer, but not quite identical. I'm comparing 2 files side by side using "diff"; certain things are preventing it from having 100% line match. For example, in my file the closing button tag |
Likey a defect pertaining in the markup lexer which happens when handling JSX. Prettier and PrettyDiff handle input in vastly different manners, PrettyDiff generates a data structure whereas Prettier is working with external parsers to product an AST. Sparser is what is producing the structures in PrettyDiff. Based on the work I have done in Prettify (FYI: Diffing is not available in Prettify), I can say with certainty there are several defects pertaining to JSX processing and resulting output. It's hard to give you a definitive or solution tbh. You could also try block comments |
@panoply I thought about what you said before ... what I had done previously was wrap my now I'm really close - the only problem is that it isn't enforcing the line's character limit (120 characters) ... so off by a few lines. trying to find a way to enforce this but not parse anything else. I appreciate your help on this! |
You need to set wrap limit, eg: prettydiff.options.wrap = 120
prettydiff() Bare in mind that Prettier might be problem here and not PrettyDiff. Prettier defaults to a 80 character word wrap. |
Trying to use this because it's already working, but I need to preserve the line numbers as they actually exist in the file. Is there any recommended way to do this? Using mainly for React JS files.
The text was updated successfully, but these errors were encountered: