1

Started using prettier-plugin-apex and by default the printWidth is 80, I changed it to 120, but it still defaults to 80.

Changed at both user and workspace level. I see this ( "prettier.": 120,) in seetings.json too, but still it does not work. I even tried restarting the vs code

2 Answers 2

1

I need to update the .prettierrc in root directory, not the extension settings

{
  "trailingComma": "none",
  "overrides": [
    {
      "files": "**/lwc/**/*.html",
      "options": { "parser": "lwc" }
    },
    {
      "files": "*.{cmp,page,component}",
      "options": { "parser": "html" }
    }
  ],
  "printWidth": 120
}
0

In .prettierrc file paste the following code and restart the VS code. it will work. You can change the printwidth from 80 to 120 as required.

{   "trailingComma": "none",   "printWidth":120,   "tabWidth":4,   "overrides": [
    {
      "files": "**/lwc/**/*.html",
      "options": { "parser": "lwc" }
    },
    {
      "files": "*.{cmp,page,component}",
      "options": { "parser": "html" }
    }   ] }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .