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

Runs When it Shouldn't #87

Open
jherdman opened this issue Aug 21, 2020 · 11 comments
Open

Runs When it Shouldn't #87

jherdman opened this issue Aug 21, 2020 · 11 comments
Labels
bug Something isn't working

Comments

@jherdman
Copy link

Given some project that DOES NOT use Prettier, coc-prettier, when using the following configuration, will run on save:

{
  "coc.preferences.formatOnSaveFiletypes": ["css", "markdown"]
}

This is actually as documented! I propose that prettier.requireConfig should default to true. I believe that this is the expected behaviour of this plugin.

@jherdman
Copy link
Author

Another thing I should note is that prettier.requireConfig doesn't seem to work. Even when a configuration file is absent formatting runs.

@chemzqm chemzqm added the bug Something isn't working label Sep 10, 2020
@chemzqm
Copy link
Member

chemzqm commented Sep 10, 2020

It doesn't work when you have global prettier config file.

@jherdman
Copy link
Author

jherdman commented Sep 10, 2020 via email

@chemzqm
Copy link
Member

chemzqm commented Sep 10, 2020

Could be prettier config file in one of the parent folders.

@jherdman
Copy link
Author

Could be prettier config file in one of the parent folders.

Is this behaviour part of Prettier or this plugin?

@chemzqm
Copy link
Member

chemzqm commented Sep 10, 2020

It's resolved by prettier

@atomdmac
Copy link

atomdmac commented Apr 12, 2021

(Apologies for the necromancy): I'm running into this as well. Running the following results in no output:

prettier --find-config-path ./

However, if I add a .prettierrc to my project directory, the same command yields this output:

.prettierrc

This indicates to me that the issue is not that a global config is being used. Is there something else I can check?

@brandonpittman
Copy link

brandonpittman commented Apr 13, 2021

I'm sure it's because you have an .editorconfig file in the root. That's what I just got bit by. Deleted that file from the root and the unwanted formats stopped.

@brandonpittman
Copy link

This plugin could really use an option to disable using .editorconfig.

@jherdman
Copy link
Author

That is definitely what it is for me. I glossed right over that in the docs.

@atomdmac
Copy link

Can confirm that it was my issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants