Closed kergian closed 4 months ago
The extension is still using prettier 2.8.8 with the defaults configuration from that version. The default value of trailingComma was changed in prettier 3.0.0.
According to the Readme we should have it in version 10 of the extension.
I personally can't wait, in our project we don't create a config file because we rely on the default provided by prettier. At the moment we are in a situation where the extension run with it's own internal outdated config while our CI tools runs with the default from prettier 3, conflicting with each others.
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
For some strange reason, even considering @Tri125 comment, I have everything working as it should, latest version of the extension: v10.1.0
, there is no trailingComma
parameter in the config, but the plugin puts a comma after function parameters if they look like multilines.
trailingComma
has been also reverted from all
to es5
as it is in prettier 2.x (commit).But as kergian says, placing a .prettierrc
prevents the extension's prettier setting to be used.
It works even though the .prettierrc
has no entries (it requires {}
- an empty file won't work). The implementation only falls back to the extension's Prettier options if no config file exists (PrettierEditService.ts#L528) as README says.
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Summary
While configuring my
Prettier
(only as a plugin forVSCode
) with the.prettierrc
config file, I found that according to documentation, the default value oftrailingComma
is either ignored by the plugin or it is not the right value in the documentation.The documentation says the default value is
all
, while the code is formatted according to the valuees5
.As it was found: function parameters are divided into several lines, in the default Prettier config the comma after the last parameter is removed
Steps To Reproduce:
trailingComma
configure parameterExpected result
According to the documentation for the value
all
there must be a comma after the last argument of the function if the argument is divided into a set of linesVS Code Version:
Version: 1.81.0-insider Commit: 31f183271b0d1f24a2052f6eccbb76bdef45d60b Date: 2023-07-07T05:35:32.760Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin arm64 22.5.0
Prettier Extension Version:
9.19.0
OS and version: macOS Ventura 13.4.1 (22F82)