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
This extension provides basic integration with Prettier for most cases no further action is needed.
260
260
261
+
Make sure your editor has format on save set to true.
262
+
When you save VSCode will ask you what formatter would you like to use for the solidity language, you can choose `JuanBlanco.solidity`.
263
+
264
+
At this point VSCode's `settings.json` should have a configuration similar to this:
265
+
266
+
```JSON
267
+
{
268
+
"editor.formatOnSave": true,
269
+
"solidity.formatter": "prettier", // This is the default so it might be missing.
270
+
"[solidity]": {
271
+
"editor.defaultFormatter": "JuanBlanco.solidity"
272
+
}
273
+
}
274
+
```
275
+
261
276
If you want more control over other details, you should proceed to install [`prettier-vscode`](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode).
262
277
263
278
```Bash
@@ -270,10 +285,28 @@ To interact with 3rd party plugins, `prettier-vscode` will look in the project's
This will allow you to specify the version of the plugin in case you need to freeze the formatting since new versions of this plugin will implement tweaks on the possible formats.
288
+
This will allow you to specify the version of the plugin in case you want to use the latest version of the plugin or need to freeze the formatting since new versions of this plugin will implement tweaks on the possible formats.
274
289
275
290
You'll have to let VSCode what formatter you prefer.
276
-
As a final check, make sure that VSCode is configured to format files on save.
291
+
This can be done by opening the command palette and executing:
292
+
293
+
```
294
+
>Preferences: Configure Language Specific Settings...
Note: By design, Prettier prioritizes a local over a global configuration. If you have a `.prettierrc` file in your porject, your VSCode's default settings or rules in `settings.json` are ignored ([prettier/prettier-vscode#1079](https://github.com/prettier/prettier-vscode/issues/1079)).
0 commit comments