Prettier-atom: Using the version of prettier described in packages.json

Created on 11 Jun 2017  路  6Comments  路  Source: prettier/prettier-atom

I see that the project has a dependency on prettier 1.4.4, so I assume it's using that.
However, with my current project, I'm using 1.3.1, while at work we use 1.4.2.

Is there a way the plugin could use the version installed for the current project, found in the dependencies?

question

Most helpful comment

Closing this for now, please let me know if there's still something to be resolved and I will reopen

All 6 comments

It already does, if prettier is installed in your project's dependencies.
We need to update our documentation to detail all the different behaviors.

It doesn't seem like prettier-eslint is using a local version if it's available as seen in executePrettierOnBufferRage.
getPrettierInstance is what gets the local instance of prettier if available but prettier-eslint doesn't have a counter-part.

In buildPrettierEslintOptions, we provide the filePath option which should be enough according to the docs.

For ESLint and Prettier paths, it says:

By default, prettier-eslint will try to find the relevant eslint (and prettier) module based on the filePath. If it cannot find one, then it will use the version that prettier-eslint has installed locally. If you'd like to specify a path to the eslint module you would like to have prettier-eslint use, then you can provide the full path to it with the eslintPath option.

My understanding is that the default is to look in the project first.

Ooh, missed that. I guess I was too focused on this project to even consider looking at the dependencies docs :p

You're doing great work here, don't you ever forget that :+1:

Closing this for now, please let me know if there's still something to be resolved and I will reopen

Thanks for the feedback guys, awesome work!

Was this page helpful?
0 / 5 - 0 ratings