Experimental CLI does not support max_line_length from .editorconfig
Environments:
- Prettier Version: 3.6.0
- Running Prettier via: CLI
- Runtime: Node
- Operating System: Windows
Steps to reproduce:
..\node_modules\.bin\prettier.cmd --ignore-path ../.prettierignore --write .
and
..\node_modules\.bin\prettier.cmd --ignore-path ../.prettierignore --experimental-cli --write .
produces the same output. Hurray.
But having max_line_length = 120 in .editorconfig is not handled in experimental-cli.
Interesting 🤔
That is indeed not supported at the moment in the thing we are using for parsing .editorconfig files.
Interestingly there's no mention of this property in EditorConfig's own website, but it seems mentioned in their wiki, that's why I didn't know this existed.
It should be an easy fix, thanks for reporting the issue 👍
ref https://prettier.io/docs/options#print-width
and other references to editorconfig at this page.
While we are on this, please support "off"
https://github.com/prettier/prettier/blob/75bdb5d5de50308c396657dcbda70b60798f5d09/src/config/editorconfig/editorconfig-to-prettier.js#L48
Though there is an open issue about this, https://github.com/prettier/prettier/issues/17514, let's just align with the current behavior of Prettier.
@fisker is there an issue in editorconfig's repo tracking that? 🤔 Is "off" documented in Prettier's docs?
is there an issue in editorconfig's repo tracking that?
As far as I know, there is not.
Is "off" documented in Prettier's docs?
No, it's undocumented, but it's better to stay the way it works. We properly not going to do anything about https://github.com/prettier/prettier/issues/17514.