Prettier-vscode: Doesn't work with version 1.19.2

Created on 23 Jan 2018  Â·  20Comments  Â·  Source: prettier/prettier-vscode

This extension doesn't work after updating vscode to version 1.19.2

locked

Most helpful comment

Seems something wrong between vscode and this extension.

  1. Uninstall it
  2. Quit vscode
  3. Delete the extension's folder $HOME/.vscode/extensions/esbenp.prettier-vscode if it still exists
  4. Install the extension
  5. Restart vscode

If it still doesn't work, debugging it is the last thing I see.

All 20 comments

Yep me too.

Uninstall prettier, and try again ~

Hum SCSS Format doesn't work after reinstall prettier. Just Javascript work fine

My settings :

{
    "editor.formatOnSave": true
}

For some reason, the Prettier extension disappeared completely from my installed extensions.
I had to install it, uninstall it, and then install it again and reload VS Code for it to work again.
Thanks @jenkey2011

I have the same issue. I installed VS Code on my laptop. Tried to install Prettier and it takes a long time to install. I stop it. Close VSCode. I check my extensions and it isn't there. Then I try to install again from the extensions list and the same thing happens. Prettier just doesn't want to install on this version of VS Code.

After much frustration, it finally installed and worked.

I still can not use it in 1.19.2. I have uninstalled it and reloaded it twice.

@xiaoyueyue165 You know what I did and its maybe the reason it worked for me? I used RevoUninstaller and used that to find every file that was linked to VSCode and I deleted it. Then I installed it again and it worked fine. I'm not sure if that will fix it for you but it worked for me using RevoUninstaller on Windows.

Seems something wrong between vscode and this extension.

  1. Uninstall it
  2. Quit vscode
  3. Delete the extension's folder $HOME/.vscode/extensions/esbenp.prettier-vscode if it still exists
  4. Install the extension
  5. Restart vscode

If it still doesn't work, debugging it is the last thing I see.

@CiGit
It worked here, but there is a caveat. You should install the extension and immediately close the vscode, then open vscode.

When I installed and reloaded the window to load the extension, it didn't work, even after restarting/closing/reopening vscode.

@apolloinfinity
So you are saying that you reinstalled vscode with a professional uninstall tool, is that right?

@sutter Seems to be partially working. Do you have any other formatter for scss ?

Doesn't work for me for JS/JSX react components. It reports an error in the console but I am not able to reformat code. Version 1.19.3

@johny Do you mind sharing the error ?

VSCode is now at v1.22.2. As there are no more input here, I would assume this is _fixed_

Still facing the same issue, "SCSS Format doesn't work after reinstall prettier. Just Javascript work fine".

It works finally after I delete the .prettierrc.json in my home directory.

The configuration setting in .prettierrc.json is:

{
  "$schema": "http://json.schemastore.org/prettierrc",
  "printWidth": 80,
  "tabWidth": 2,
  "useTabs": false,
  "printWidth": 80,
  "singleQuote": true,
  "trailingComma": "none",
  "bracketSpacing": true,
  "jsxBracketSameLine": false,
  "parser": "babylon",
  "semi": true,
  "requirePragma": false,
  "proseWrap": "preserve",
  "arrowParens": "avoid",
  "overrides": [
    {
      "files": ".prettierrc",
      "options": { "parser": "json" }
    }
  ]
}

followed all the steps on this thread and still didn't work for me.
VSCode version 1.30.2
Prettier extension 1.7.3

I don't have a prettierrc.json on my home folder...

It works for JS/JSON files.

image

I gave up on this. Ended up installing stylelint and its VSCode extension, then adding the stylelint-prettier plugin. So now stylelint checks my scss files and includes errors from prettier like I wanted.

So this gets me almost there. I can't use the Fix All command in VSCode to run prettier, but if I run Format Document then it does runs prettier and fixes the problems.

  • Errors are reported by stylelint in VSCode using the extension + stylelint-prettier npm package
  • Actual prettier is used by running Format Document in VSCode

As a side note, running Format Document works regardless of the style lint plugin being installed, but by installing it you can see the errors in VSCode.

I've managed to make the Prettier format my .scss file by changing following line in my User/settings.json:

"editor.defaultFormatter": "vscode.configuration-editing",
->
"editor.defaultFormatter": "esbenp.prettier-vscode",

I hope this helps

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

Related issues

bluemoehre picture bluemoehre  Â·  3Comments

DanielHabenicht picture DanielHabenicht  Â·  4Comments

Connorelsea picture Connorelsea  Â·  4Comments

Glinkis picture Glinkis  Â·  4Comments

Tanmccuin picture Tanmccuin  Â·  3Comments