Prettier-vscode: Trailing Comma "all" setting breaking JSON

Created on 28 Jun 2017  路  13Comments  路  Source: prettier/prettier-vscode

Having the trailing comma option set to all sets it on JSON entries as well. This is causing syntax errors and I have to disable prettier to edit JSON files unless I turn of trailing commas.

jun-27-2017 22-00-11

bug locked

Most helpful comment

@dacz The patch is on master but not yet released. Diff between master and 1.5.2 (we bundle 1.5.1 for now) https://github.com/prettier/prettier/compare/1.5.2...master

@vjeux Do you plan on a patch release soon?

All 13 comments

I have a very similar issue... but it is doing it if I have any trailing comma setting. It also seems to be saving my settings file even if I don't have it open and am doing something completely different. It constantly resaves and reformats my settings.json file (with trailing commas).

@kkemple @Goblinlordx I have the same issue here.
Maybe this is a VSCode issue? https://github.com/Microsoft/vscode/issues/29701

I m pretty sure it started occurring when I updated prettier though and not a VScode update. I really wish there was an easy way to revert to an older plugin version to test =/.

For trailing-comma all, could you reopen prettier/prettier#2308 @kkemple

For the other part of the issue, I don't get it for now.

I see they pushed patch for this 22 hours ago. Is it possible to update plugin, please? Thanks a lot.

quick fix: add "prettier.jsonEnable": [] to your vscode settings

@infernojs thanks

@dacz The patch is on master but not yet released. Diff between master and 1.5.2 (we bundle 1.5.1 for now) https://github.com/prettier/prettier/compare/1.5.2...master

@vjeux Do you plan on a patch release soon?

@rafaelkallis, do you get this error on saving a JSON file even after turning JSON off?

Unexpected token, expected ; (2:9)

@cuth having it only when editing json files. json still get saved though.

@cuth your error seems weird to me. This doesn't seem to be a JSON error.

@CiGit, looks like it is just related to updating settings and upgrading prettier in node_modules but not restarting vscode. Thanks!!

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.

Was this page helpful?
0 / 5 - 0 ratings