Next.js Discord

Discord Forum

prettier remove line wraps

Answered
B33fb0n3 posted this in #help-forum
Open in Discord
Hey, I just installed prettier and changed some settings. After using it a while the formatting looks pretty ugly (see attached). It could look so much simpler (see attached). How to change that specific setting?

My current settings are:
"prettier.endOfLine": "auto",
"prettier.bracketSameLine": true,
"prettier.singleQuote": true,
"prettier.tabWidth": 4,
"prettier.useTabs": true,

I tried removing all my custom settings ^ , but the wrapping is still messy.
Answered by joulev
dunno what happened in your end but
// prettier.config.js
module.exports = {
  semi: true,
  printWidth: 100,
  arrowParens: "avoid",
  tabWidth: 2,
}
View full answer

8 Replies

Asian black bear
This is controlled by the printWidth setting.
@Asian black bear This is controlled by the `printWidth` setting.
I just tried setting this setting to 1200 (just to make sure this is the specific setting), but it still wraps these lines
Eastern yellowjacket
change printWidth to 120 hehe
bump
bump
dunno what happened in your end but
// prettier.config.js
module.exports = {
  semi: true,
  printWidth: 100,
  arrowParens: "avoid",
  tabWidth: 2,
}
Answer
@joulev dunno what happened in your end but tsx // prettier.config.js module.exports = { semi: true, printWidth: 100, arrowParens: "avoid", tabWidth: 2, }
oh yes, that's it. It looks like it need to be especially inside the prettier config instead of the vscode settings. Thanks 👏