Prettier-vscode: Use global `prettier` package as a fallback when Prettier is not installed inside a project.

Created on 23 Jul 2018  路  5Comments  路  Source: prettier/prettier-vscode

When inside a directory with a package.json that has prettier as a dependency, this extension will not format a document until I run yarn install (or npm install), even if I have prettier installed globally on the machine. Seems like the extension should check for a global fallback rather than just failing.

enhancement locked

Most helpful comment

I propose this order: local > global > bundled

All 5 comments

This extension has a bundled version integrated, however I agree it should use this method of checking:
global > local > bundled

It's true, it fails if you have a prettier declared in your deps but not installed.
It uses a bundled version if it's not specified.

We should show an error message in the first case.

I propose this order: local > global > bundled

The order that @yuhr provided makes more sense. If you work in a team and have a certain version locally than you want to use that version. Otherwise use the global one, if you don't have it, use the bundled one.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Connorelsea picture Connorelsea  路  4Comments

ZiiMakc picture ZiiMakc  路  4Comments

SkeLLLa picture SkeLLLa  路  4Comments

PetrykowskiM picture PetrykowskiM  路  3Comments

GantMan picture GantMan  路  3Comments