Prettier-vscode: Add option to disable prettier

Created on 4 Jul 2017  路  6Comments  路  Source: prettier/prettier-vscode

Our team VSCode and we have our workspace .vscode\settings.json checked in to source control so that is shared amongst the team.

We don't yet use prettier on all projects, so would like to disable it on a per-project basis, team-wide. If we had an option to be able to disable prettier, we could add it to the shared workspace settings.

I understand that it is possible to disable the the extension from the settings cog, (as mentioned in #40), but I have no idea where this is saved, certainly not in the workspace settings.json.

Most helpful comment

I don't know where those disabled extensions are saved.
This is certainly an issue for VSCode. It seems to me I've seen something similar there.
Maybe some workaround for now:

  • Use prettier everywhere :fire:
  • Disable formatOnSave in those workspace settings.

All 6 comments

I don't know where those disabled extensions are saved.
This is certainly an issue for VSCode. It seems to me I've seen something similar there.
Maybe some workaround for now:

  • Use prettier everywhere :fire:
  • Disable formatOnSave in those workspace settings.

And just thinking about it:
If you empty javascriptEnable array it will be disabled 馃ぃ (for javascript)
Same thing for the other typescriptEnable / cssEnable / graphqlEnable / jsonEnable

Thanks for your response.

We're progressing towards Prettier everywhere ;-) On those projects where we're not using Prettier, we're still using formatOnSave, so disabling that is not really an option.

Your second suggestion of assigning empty arrays will probably work, thanks (a single disable option would be easier though!).

a single disable option would be easier though!

Maybe for your use case, but having multiple options to do the same would certainly lead to some confusion.

For any future reader, at current time of writing the following set to the Workspace settings.json did the trick for me (in my case, enabling eslint rather than prettier for a single project):

{
  "eslint.format.enable": true,
  "[javascript]": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
  }
}

Thanks @alukach, that worked for me. I also had to add it for "[vue]" in my case. I really wish there was a more direct way of disabling prettier for a specific project or directory.

Was this page helpful?
0 / 5 - 0 ratings