0

enter image description here

I can't change the default formatter to prettier.
When I select esbenp.prettier-vscode it automatically chages back to null both for user and workspace setting.
I uninstalled and re-installed prettier, edited the setting.json to:

{
    "window.zoomLevel": 0,
    "prettier.insertPragma": true,
    "prettier.requireConfig": true,
    "prettier.requirePragma": true,
    "prettier.resolveGlobalModules": true,
    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true
}

Still it won't work.

Gama11
  • 31,714
  • 9
  • 78
  • 100

1 Answers1

2

Does your packages.json configure a specific code formatter? It could be that some kind of project-specific setting is telling vs code to format in a different way. I know the linter settings can override user settings, seems reasonable the formatter could do the same.

cv_cinci
  • 23
  • 4
  • Thanks so much, I believe you are right because I started experiencing this problem after I pulled and merged from my team mate's repository. I am currently checking the package.json – VICTOR EJIOFOR Oct 20 '20 at 18:13
  • Yeah, I had the same thing happen with eslint. So I figure it's a reasonable thing to check. – cv_cinci Oct 20 '20 at 18:19