neoclide/coc-prettier

Prettier doesn't auto-wrap code if printWidth is set in .prettierrc

kecerud opened this issue · 1 comments

I have a .prettierrc file in root of my project with following values:

{
	  "printWidth": 100,
	  "tabWidth": 2,
	  "semi": true,
	  "singleQuote": true,
	  "trailingComma": "es5",
	  "endOfLine": "auto"
}

The problem is, that if i have a long string for example, the prettier won't wrap it and keeps it for the whole terminal width:
Screenshot 2022-01-25 at 15 45 51

Temporary fix is to set columns=100 directly in nvim/init.vim but I'm still confused why this doesn't work here and it works on vscode for example normally.
Screenshot 2022-01-25 at 15 50 31

Use :CocCommand prettier.open-output to make sure you're using coc-prettier that that buffer.