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

Search for a copy of prettier installed relative to view #207

Merged
merged 1 commit into from
Apr 5, 2020

Conversation

nsfmc
Copy link
Contributor

@nsfmc nsfmc commented Apr 3, 2020

When prettier_cli_path is empty, this adds one more lookup for the prettier binary, starting first with the closest ancestor of the view asking to be prettified.

In practice this allows projects and monorepos to invoke the version of jsprettier "closest" to the file being modified rather than needing to specify a project-level (or system-level) prettier binary.

This could potentially be disruptive for monorepos or complex projects that explicitly use the current lookup behavior, so i am 100% ok with this not being used (or the approach being changed). Also the helper fn is a bit awkward, but it's been working for me.

again feel free to close if this is too weird or if you're not down with the approach

take it easy!

this is a slight extension of the existing behavior, but adds the
ability to use a copy of prettier that is installed relative to the
current view.
@jonlabelle jonlabelle merged commit bb9855c into jonlabelle:master Apr 5, 2020
@jonlabelle
Copy link
Owner

Thanks @nsfmc! I made a few refacotrings; and I'll release it shortly!

@nsfmc
Copy link
Contributor Author

nsfmc commented Apr 8, 2020

thanks @jonlabelle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants