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

Option to disable printWidth for JSX, JavaScript, etc. #503

Open
gkiely opened this issue Apr 7, 2021 · 1 comment
Open

Option to disable printWidth for JSX, JavaScript, etc. #503

gkiely opened this issue Apr 7, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed needs-discussion

Comments

@gkiely
Copy link

gkiely commented Apr 7, 2021

prettier/prettier#3468
prettier/prettier-vscode#352 (comment)
prettier/prettier-vscode#888
https://stackoverflow.com/questions/54325979/disable-printwidth-on-prettier
prettier/prettier#3101
prettier/prettier#4298 (comment)

Would be great if there was a way to disable printWidth so I can define the new lines as I see fit, especially for JSX.

@brody4hire brody4hire added enhancement New feature or request help wanted Extra attention is needed invalid This doesn't seem right needs-discussion labels May 24, 2021
@brody4hire brody4hire changed the title Option to disable printWidth More flexible line breaks May 24, 2021
@brody4hire brody4hire removed the invalid This doesn't seem right label May 24, 2021
@brody4hire brody4hire changed the title More flexible line breaks Option to disable printWidth formatting behavior May 24, 2021
@brody4hire brody4hire changed the title Option to disable printWidth formatting behavior Option to disable printWidth for JSX, JavaScript, etc. May 24, 2021
@brody4hire
Copy link
Owner

My apologies for the delay, I have taken the liberty to update the title (multiple times)). My understanding is that this request can be broken down into the following parts:

Porting the existing PR for JSX (prettier/prettier#4862) is now under serious consideration.

To "disable printWidth" behavior for source code in general (prettier/prettier#3468) may require a pretty major rework of the existing Prettier code ... maybe enough to justify a rewrite. To respect the line breaks in the original code, a code reformatter would have to check for and work around the input line breaks before or after every single token in the AST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed needs-discussion
Projects
None yet
Development

No branches or pull requests

2 participants