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: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,8 @@ All notable changes to the "prettier-vscode" extension will be documented in thi
14
14
- Fixed parser detection fallback when using plugins with Prettier v3
15
15
- Added new Prettier v3 options: `objectWrap`, `experimentalOperatorPosition`
16
16
- Added support for TypeScript config files (`.prettierrc.ts`, `.prettierrc.cts`, `.prettierrc.mts`, `prettier.config.ts`, etc.) introduced in Prettier 3.5.0 - Thanks to [@dr2009](https://github.com/dr2009)
17
+
- Added `source.fixAll.prettier` code action for use with `editor.codeActionsOnSave` to run Prettier before other formatters like ESLint (#1277)
18
+
- Fixed issue where unnecessary TextEdits were applied when document was already formatted, which could cause spurious changes or cursor positioning issues (#3232)
Copy file name to clipboardExpand all lines: README.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,6 +256,31 @@ The problem matchers will parse Prettier's output and display:
256
256
- Syntax errors with file, line, column, and error message
257
257
- Warnings for files that need formatting
258
258
259
+
### Using Code Actions on Save
260
+
261
+
You can use VS Code's `editor.codeActionsOnSave` to run Prettier before other formatters like ESLint. This is useful when you want to format with Prettier first and then apply ESLint fixes.
262
+
263
+
```jsonc
264
+
// .vscode/settings.json
265
+
{
266
+
"editor.codeActionsOnSave": {
267
+
"source.fixAll.prettier":"explicit",
268
+
},
269
+
}
270
+
```
271
+
272
+
You can also combine Prettier with ESLint:
273
+
274
+
```jsonc
275
+
// .vscode/settings.json
276
+
{
277
+
"editor.codeActionsOnSave": {
278
+
"source.fixAll.prettier":"explicit",
279
+
"source.fixAll.eslint":"explicit",
280
+
},
281
+
}
282
+
```
283
+
259
284
## Workspace Trust
260
285
261
286
This extension utilizes VS Code [Workspace Trust](https://code.visualstudio.com/docs/editor/workspace-trust) features. When this extension is run on an untrusted workspace, it will only use the built in version of prettier. No plugins, local, or global modules will be supported. Additionally, certain settings are also restricted - see each setting for details.
0 commit comments