0

I've got a project and the auto-format on line width is driving me insane. I tried setting it to 999 characters as some recommended, but then it FORCES all of my lines that I want to be broken up into one line.


I set "printWidth": 999 in my .prettierrc and I set 'max-len': 'off' in .eslintrc.cjs and it now formats long lines in one line but it

  1. Still yells at me saying to replace the spaces with newlines (eslint(prettier/prettier)) and

  2. If I want to make a new line it forces me to put it back to one when I format...

How can I tell ESLint and Prettier to just leave me alone in terms of line length?


I don't want my lines forcibly reformatted and always underlined in red or orange. Also setting print width to Infinity and false does not work.


Related questions:

ESLint / Prettier -- enforce max-len / printWidth, but don't require it?

disable printWidth on prettier

https://github.com/prettier/prettier/issues/3468

https://prettier.io/docs/en/options.html

How to disable eslint rule max line length for paragraph in <template> of vue.js? (I'm not using Vue but still)

Justin
  • 945
  • 12
  • 26
  • I think the cores problem are 1) that even though `max-len` is set to off in my eslint config, it STILL underlines in red 2) prettier still formats my lines because it doesn't like the line length – Justin Jul 22 '23 at 18:58
  • You can't. You can turn off rules in ESLint, but Prettier is a lot more opinionated - the point is not to spend time thinking about layout, if you want your code "just so", _don't use it_. – jonrsharpe Jul 22 '23 at 19:06
  • So there's no way to turn off the line length rule / formatting? I'm fine with it being opinionated, but just this one thing I want to not be forced on me. – Justin Aug 01 '23 at 02:33

0 Answers0