Custom Prettier Resolution
See original GitHub issueInstead of needing to have prettier installed in your current folder’s node_modules directory it’d be nice to have the option to specify where you’d like the extension to look for your prettier installation. Resolution strategy would be as follows:
- If “prettier.path” is defined try to use that.
- See if there’s a copy in the current directory’s node_modules folder.
- Use a copy of prettier bundled with the installation.
The issue I ran into: I’m using yarn workspaces and it hoists dependencies if they’re shared between different workspaces. Because of this my prettier installation isn’t in the individual workspace’s node_modules folder. It’d be nice to have the ability to set the following in my .vscode/settings.json file:
"prettier.path": "../../node_modules/prettier"
Thoughts?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:20
- Comments:22 (11 by maintainers)
Top Results From Across the Web
Configuration File - Prettier
A .prettierrc.toml file. The configuration file will be resolved starting from the location of the file being formatted, and searching up the file...
Read more >How to configure Prettier and VSCode - Gleb Bahmutov
You can configure JavaScript code auto-formatting with Prettier to work ... Format JSON files with Prettier; Use custom settings overrides.
Read more >Prettier vscode extension ignoring config files - Stack Overflow
And in the official docs, the config file resolution precedence is: A "prettier" key in your package.json file. A .prettierrc file written in ......
Read more >Efficient workflow with ESLint and Prettier - Dhanraj Padmashali
How I configure ESLint and Prettier to catch style and code issues ... module resolution, module alias/mapping and custom file extensions.
Read more >vim-prettier - A vim plugin wrapper for prettier : vim online
A vim plugin wrapper for prettier, pre-configured with custom default prettier settings. ... You can send commands to the resolved `prettier` cli by:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Same issue here, with mono repo
yarn workspace is hoisting
prettiertoproject-root/node_modulesIs there any workaround at the moment? Using lerna and prettier gets hoisted. Im suspecting this is why VS code does not apply prettier on save.