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

Cannot set proseWrap to always when using .editorconfig #2248

Closed
colinsmetz opened this issue Oct 18, 2021 · 4 comments
Closed

Cannot set proseWrap to always when using .editorconfig #2248

colinsmetz opened this issue Oct 18, 2021 · 4 comments
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@colinsmetz
Copy link

This issue is in reaction to what I've read on #2155

If I understand, if a .editorconfig file is present, the VS Code settings are completely ignored. Is that correct? I was hoping that the precedence rules explained in the doc would apply per parameter.

This is an issue for me as I have a .editorconfig with the max_line_length setting, that I would like to use. However, this setting has no effect unless I pass the prose-wrap: always option to prettier (it works when I run it with the CLI). And, as far as I know, there is no way to configure proseWrap from the .editorconfig.

What can I do? Ideally, I'd like options that cannot be described via .editorconfig to use the VS Code default.

@colinsmetz colinsmetz changed the title Cannot set proseWrap to always when using .editorconfig Cannot set proseWrap to always when using .editorconfig Oct 18, 2021
@ntotten
Copy link
Member

ntotten commented Jan 1, 2022

You can't use all formatting options in editor config. Editor config only defines the following options: https://editorconfig.org/#file-format-details

@ntotten ntotten closed this as completed Jan 1, 2022
@colinsmetz
Copy link
Author

I think my description was unclear :) I know editorconfig has a limited set of formatting options, and I know I won't be able to define the prose-wrap option using editorconfig.

My point is: I do use editorconfig for the few options that it supports, but I also want to be able to define the prose-wrap option. For now, the existence of a .editorconfig file means that I can't configure other options using VS Code settings (or at least that's what it seemed when I opened this issue 2 months ago).

I wish it would instead behave like that:

  • Max line length: max_line_length is defined in .editorconfig--> use that value
  • Prose wrap: editorconfig does not support such an option at all --> use the VS code setting

Wouldn't it make sense? Would it be too complex?

@ntotten
Copy link
Member

ntotten commented Jan 3, 2022

Prose wrap: editorconfig does not support such an option at all --> use the VS code setting

This is the part that gets super complicated. My suggestion is to use a .prettierrc file for settings. Right now if you use ANY config file in the project VS Code settings are ignored. We've tried other ways of merging and anything else results in too many inconsistencies. The basic idea is that if a project has ANY config, then that is the ONLY config it should use so that anyone who works in that project has the exact same formatting settings regardless of if they use VSCode with the extension, the CLI directly, or any other editor.

@github-actions
Copy link

github-actions bot commented Apr 4, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Apr 4, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

2 participants