You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,6 +138,22 @@ This extension bundles Prettier 3.x by default. If your project has a local inst
138
138
139
139
This extension supports [Prettier plugins](https://prettier.io/docs/en/plugins.html) when you are using a locally or globally resolved version of prettier. If you have Prettier and a plugin registered in your `package.json`, this extension will attempt to register the language and provide automatic code formatting for the built-in and plugin languages.
140
140
141
+
### Docker and Custom Environments
142
+
143
+
If you use Docker or other containerized development environments, you can configure the extension to run Prettier inside the container using the [`prettier.prettierExecutable`](#prettierprettierexecutable) setting. This allows you to use the specific version of Prettier and its dependencies that are installed in your container.
**Note:** The `-T` flag for `docker compose exec` disables pseudo-TTY allocation, which is required for stdin/stdout handling.
154
+
155
+
Alternatively, consider using [VS Code Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) to develop directly inside the Docker container, which allows the extension to work normally with the containerized Prettier installation.
156
+
141
157
## Configuration
142
158
143
159
There are multiple options for configuring Prettier with this extension. You can use [VS Code settings](#prettier-settings), [prettier configuration files](https://prettier.io/docs/en/configuration.html), or an `.editorconfig` file. The VS Code settings are meant to be used as a fallback and are generally intended only for use on non-project files. **It is recommended that you always include a prettier configuration file in your project specifying all settings for your project.** This will ensure that no matter how you run prettier - from this extension, from the CLI, or from another IDE with Prettier, the same settings will get applied.
@@ -285,6 +301,32 @@ Supply a custom path to the prettier module. This path should be to the module f
285
301
286
302
**Disabled on untrusted workspaces**
287
303
304
+
#### prettier.prettierExecutable
305
+
306
+
Supply an external executable to run Prettier instead of loading it as a module. This is useful for scenarios like Docker where Prettier needs to run in a different environment.
307
+
308
+
The value should be an array where the first element is the executable path and subsequent elements are arguments. For example:
0 commit comments