Open ChikaFujiwara opened 2 years ago
Our process may not be compatible with the VS Code plugin. While not ideal, does the VS Code plugin work if you globally install your prettier config package?
Our process may not be compatible with the VS Code plugin. While not ideal, does the VS Code plugin work if you globally install your prettier config package?
Sadly no. Now I use vscode workspace and install the prettier config in every package to work around.
Looking at the documentation (https://prettier.io/docs/en/configuration.html#sharing-configurations). you could work around this by using a .prettierrc.js
file and require
-ing the installed prettier config directly from the common/temp/node_modules/...
path to the prettier config you want to use, or to the node_modules
of some stub project set up to provide the prettier config package. This would mean that rush install
would need to be run before prettier could be used, but I think this would be expected anyway.
Summary
I want to use prettier plugin with sharing config from a npm package, but don't know how.
Details
I want to use sharing prettier config from a npm package https://prettier.io/docs/en/configuration.html#sharing-configurations.
I have read the rush doc of how to enable prettier, But how can I use it with the vscode prettier plugin?
I tried to add
"@azz/prettier-config"
to the.prettierrc.json
, and the plugin saidCannot find module '@azz/prettier-config'
I don't know how to add the dependency so that the plugin can read it
Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?