-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support setting path to prettier in CLI #12
Comments
Good idea, I'm not familiar with yarn pnp, would the path you're passing with Or does that not really matter, as long as you can pass something. |
tl;dr: The entry file for the prettier JS api. Yarn's Plug'n'Play (pnp) system keeps modules in zip files in a cache directory, then does some runtime magic to make things work. This means there is no node_modules directory. This means projects take up less hard drive space, but it also has some unfortunate side effects (like everything living in zip files). They built an sdks feature which gives you back some files on disk that will link into those zips so that editor plugins have a foothold into this weird setup. For prettier, it looks like this:
If you import that console.log(require('./.yarn/sdks/prettier'));
// -> { formatWithCursor: [Function], ... } or console.log(require('./.yarn/sdks/prettier/index.js'));
// -> { formatWithCursor: [Function], ... } For |
The
eslint_d
CLI allows you to set--eslint-path
which is helpful when using things like yarn pnp sdks which wires modules together in a non-standard way. It would be nice to support a--prettier-path
CLI option or similar.mantoni/eslint_d.js#174
mantoni/eslint_d.js#177
The text was updated successfully, but these errors were encountered: