Support "max_line_length=off" #7
Comments
That makes sense to me, @chipironcin , I'd love to see a PR for this! |
@josephfrazier This change is already added to the package's codebase. Would you mind closing this issue, please? |
@willmendesneto can you clarify how it has already been added? There haven't been any commits to this repository since this issue was opened. |
I believe they are referencing https://github.com/josephfrazier/editorconfig-to-prettier/pull/3/files which only makes it ignored. |
I'm trying to remember the context from 3+ years ago, but I believe the original request was to set
|
Ha, yes it was a long time ago. Sorry to necro such an old thread, but I've been running into this lately. Does Prettier even support max_line_length=off? I couldn't find anything definitive either way. |
It's all good, happy to help if I can!
No, based on what I quoted in my previous message, Prettier cannot support |
Sure, just that I have a 'global' (
That's what I'm doing now, yeah, IMO prettier should support |
Got it, thanks for the details!
Hmm yeah, I see how it feels hacky. If Prettier did start supporting Let me think a little more about whether I want to open an issue in https://github.com/prettier/prettier/ to discuss this idea, or whether I want to go ahead and just do it, then open a PR to bump Prettier's dependency on this library. I'll get back to you later this week |
Well... it sounds like this could result in Prettier collapsing a bunch of lines into one really long line, based on the docs quoted above:
So, I'm not sure if it's a good idea after all, might need to open that issue on the Prettier repo to discuss the implications. |
That is a good point - although I haven't seen any problems with the XML files I'm working with. I would assume line length is context-dependent, as in it wouldn't try to put several JS lines delimited by a semicolon in a single line, but I don't know their internals. Please let me know if you need anything from me! |
I just opened an issue in the Prettier repo and tagged you in it, we'll see what the other maintainers say! |
Nice! Thank you! |
@celluj34, I've published v1.0.0 with this feature, and now the ball is in Prettier's court to upgrade to it (I may continue helping there!). See here for more: prettier/prettier#14514 (comment)
|
Yep, I've been watching! Thanks for getting it all done. Once that part's complete I just need VSCode to upgrade the version of prettier it's using... |
Great, hopefully we're close to having this fixed for you 👍🏻 |
@celluj34, prettier/prettier#14516 was merged, so I think the next release of Prettier should include this fix, unless it gets reverted for some reason. |
Prettier v2.8.5 has been released with the fix! https://github.com/prettier/prettier/blob/ddf3b43c33e2e98f6413b5232ad623876d96738e/CHANGELOG.md#support-max_line_lengthoff-when-parsing-editorconfig-14516-by-josephfrazier |
Editorconfig supports
off
as a valid value formax_line_length
(see https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#user-content-max_line_length)Current code only sets the Prettier property
printWidth
ifmax_line_length !== "off"
:Ideally
max_line_length = "off"
should be supported, maybe with a very high value. Also other non-numeric values for it should be discarded.I can raise a PR if this issue makes sense to the author and contributors. Please leave your feedback ;)
The text was updated successfully, but these errors were encountered: