2

Does anyone know if it's possible to configure Prettier in such a way to use up as much column space allowed, while still respecting the rest of the prettier/lint rules configured? So, if Prettier's printWidth is set to 80 for example, and your code runs over that amount, prettier will wrap the line, but if you manually wrap your lines even though they could fit within a single line, Prettier won't do the reverse and put it all on one line.

So for example:

const someObject = {
  someProperty: 'some value',
};

could easily fit into a single line: const someObject = {someProperty: 'some value'}; but prettier won't remove the new lines and put everything on one line.

Jordan
  • 148
  • 1
  • 11
  • 1
    No, its not possible. Prettier implements a formatting configuration that is considered to be **"Biased"**, meaning it comes per-configured, there are some major benefits that come from being biased, and some disadvantages. If you want to customize the formatting, then you should check out ESLint. ESLint implements an "auto-fix" feature that formats your code, and Lints it as well. It doesn't format everything that prettier does, but it is highly configurable. Most people default to ESLint now'a days. – JΛYDΞV Jun 03 '22 at 23:52

0 Answers0