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

"editorconfig" configuration prints an "Ignored unknown option" warning #13539

Open
Shayan-To opened this issue Sep 27, 2022 · 8 comments
Open
Labels
status:needs investigation Issues that need additional investigation, e.g. to understand whether the reported behavior is a bug

Comments

@Shayan-To
Copy link

Adding { "editorconfig": true } to the configuration file, although it works, but prints [warn] Ignored unknown option { editorconfig: true }. (multiple times).

Environments:

  • Prettier Version: 2.7.1
  • Running Prettier via: CLI
  • Runtime: Node.js v16.14.2
  • Operating System: Ubuntu 20.04.4
  • Prettier plugins (if any): --

Steps to reproduce:
Add { "editorconfig": true } to .prettierrc.json and run prettier.

Expected behavior:
No warn message is printed.

Actual behavior:
This message is printed (multiple times): [warn] Ignored unknown option { editorconfig: true }.

@thorn0
Copy link
Member

thorn0 commented Oct 2, 2022

That's an option of Prettier CLI, not something specified in a config file.

@thorn0 thorn0 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2022
@thorn0 thorn0 added the type:intended Bug reports that actually turned out to be intended behavior label Oct 2, 2022
@Shayan-To
Copy link
Author

@thorn0 So I think it should be removed from the json schema (it is the fifth property).

@thorn0
Copy link
Member

thorn0 commented Oct 3, 2022

Indeed, it shouldn't be there unless I'm missing something. Need to investigate. Thanks for noticing this.

@thorn0 thorn0 reopened this Oct 3, 2022
@thorn0 thorn0 added status:needs investigation Issues that need additional investigation, e.g. to understand whether the reported behavior is a bug and removed type:intended Bug reports that actually turned out to be intended behavior labels Oct 3, 2022
@danielpza
Copy link

That's an option of Prettier CLI, not something specified in a config file.

Is there any reason it cannot be specified in the config file? It actually recognizes the option if placed there.

The docs makes no mention of this either https://prettier.io/docs/en/configuration.html#editorconfig

@kotx
Copy link

kotx commented Dec 16, 2022

Why isn't this an option in .prettierrc? It would make sense that CLI flags roughly match config file options.

bajtos added a commit to filecoin-station/zinnia that referenced this issue Feb 23, 2023
Move it from `.prettierrc.yaml` to CLI arguments, see
prettier/prettier#13539

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
bajtos added a commit to filecoin-station/zinnia that referenced this issue Feb 23, 2023
* ci: run `prettier --check .`

* chore: fix prettier's option `editorconfig`

Remove it from `.prettierrc.yaml`, it seems to be
enabled by default.

See also prettier/prettier#13539

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>

* ignore `target` files (Rust build outputs)

---------

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bschaeublin
Copy link

This problem has been bothering me for some time. If I set editorconfig: true as specified in the config scheme, the editorconfig settings are respected when saved in webstorm (with prettier enabled).

But the ci check npx prettier --check . gives a warning about this "unknown" option.
It would be nice if this option was still supported in the prettier-options file, so that IDE integrations don't have to be configured separately.

@danielpza
Copy link

danielpza commented Jun 7, 2023

Can a prettier maintainer please address this issue? It doesn't make sense to be a cli option but not in the config file. Is the editorconfig option going to be supported in the .prettierrc file or not?

Are you open to PR to remove the warning and update the docs?

@rotu
Copy link
Contributor

rotu commented Aug 10, 2023

I'm finding that "editorconfig" is not respected in .prettierrc.json. It's true by default, and if I set to false in the config file, prettier still pulls settings from .editorconfig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs investigation Issues that need additional investigation, e.g. to understand whether the reported behavior is a bug
Projects
None yet
Development

No branches or pull requests

6 participants