Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Only format on save if prettier is in the dependencies #43

Closed
mxstbr opened this issue Feb 7, 2017 · 5 comments
Closed

Only format on save if prettier is in the dependencies #43

mxstbr opened this issue Feb 7, 2017 · 5 comments
Assignees

Comments

@mxstbr
Copy link

mxstbr commented Feb 7, 2017

I have projects that use prettier and adhere to the style standard, but I also have projects that neither use prettier nor adhere to the style. (they enforce some other styleguide with eslint)

It'd be great if the "Format on save" option only took effect in projects that have prettier in their package.json or something like that!

@robwise
Copy link
Collaborator

robwise commented Feb 7, 2017

I was thinking in #41 that it might be good to do a blacklist glob, that might be better because that would cover cases where people still want to use prettier for their files even though the project might not have it listed in the dependencies.

@mxstbr
Copy link
Author

mxstbr commented Feb 8, 2017

it might be good to do a blacklist glob

That seems… manual. I create new projects almost everyday, and updating a custom glob every time based on "do I want to use prettier or not" seems pretty tedious. I'm not sure I'd even enable that option just based on the fact that I'll probably forget about it.

@darahak
Copy link
Collaborator

darahak commented Feb 23, 2017

Why not both?
I think this could be fixed by a Use global installation setting, like in the linter-eslint package.
And the blacklist could solve prettier#787 for example

@blainekasten
Copy link

I'm with @mxstbr here. I came here to raise this issue. Glad to see I'm not the only one facing this. I personally do not create a new repo every day, but I'm even just thinking organizationally as I try to introduce prettier to my company, asking every person in the company to set up their blacklist creates friction points to adoption.

@robwise
Copy link
Collaborator

robwise commented Mar 21, 2017

Sorry if I've been unclear on this, we are definitely going to get this addressed. Right now the plan is we are going to look for prettier/prettier-eslint (depending on your eslint integration setting), and if we don't find it, we will have an option in the settings where you can specify if you want us to fall back to the included packaged version or just not do anything. #59 (comment)

@robwise robwise self-assigned this Jun 1, 2017
@robwise robwise closed this as completed in 1a32d47 Jun 8, 2017
robwise added a commit that referenced this issue Jun 22, 2017
…t in dependencies

We will look for prettier (prettier-eslint/prettier-eslint-cli if you have the eslint integration
setting enabled) in the package.json nearest to the file being formatted. The dependency can be in
either the "dependencies" or "devDependencies" section.

Resolves #43
robwise added a commit that referenced this issue Jun 22, 2017
…t in dependencies

We will look for prettier (prettier-eslint/prettier-eslint-cli if you have the eslint integration
setting enabled) in the package.json nearest to the file being formatted. The dependency can be in
either the "dependencies" or "devDependencies" section.

Resolves #43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants