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

Feature: enable JsPrettier only if prettier is in package.json #24

Closed
alexkuz opened this issue Mar 12, 2017 · 5 comments
Closed

Feature: enable JsPrettier only if prettier is in package.json #24

alexkuz opened this issue Mar 12, 2017 · 5 comments
Labels

Comments

@alexkuz
Copy link

alexkuz commented Mar 12, 2017

It would be nice to have an option that will allow auto_format_on_save only when prettier is in package dependencies, so there's no need to setup .sublime-project for each project.

@jonlabelle
Copy link
Owner

Hi @alexkuz, thanks for the suggestion. Though I would argue that the majority of JsPrettier users have Prettier installed globally (e.g.: npm install -g prettier), and introducing such a feature would add quite a bit of complexity (and side-affects) attempting to determine the intention of the plug-in, in out- of-scoped configurations.

@alexkuz
Copy link
Author

alexkuz commented Mar 12, 2017

Well, globally installed prettier is what causing this problem. With the current plugin I can never use auto_format_on_save=true globally (or locally - if I can't add .sublime-project to the package).

Just for the reference - SublimeLinter has a similar setting in node_linter, that is disabled by default but uses package.json when enabled:
https://github.com/SublimeLinter/SublimeLinter3/blob/master/lint/node_linter.py#L65

@jonlabelle
Copy link
Owner

To clarify, are you saying that the auto_format_on_save does not work at all for you?

@alexkuz
Copy link
Author

alexkuz commented Mar 12, 2017

No, it works just fine - what I mean is that it works for any js file (obviously) if I set it globally. And if I set globally auto_format_on_save=false, I can't enable it for a particular project without adding .sublime-project file (which can be an issue if I don't own that project, for example).

@lock
Copy link

lock bot commented Aug 1, 2019

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

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants