0
textComp() {
return this.props.GMarcha
  ? this.props.english
    ? 'On'
    : 'Encendido'
  : this.props.english
    ? 'Off'
    : 'Apagado';
}

I have this function. When I use Prettier to format it it stays like this:

textComp() {
return this.props.GMarcha
  ? this.props.english
    ? 'On'
    : 'Encendido'
  : this.props.english
  ? 'Off'
  : 'Apagado';
}

Is there any way that when formatting it stays as I put it?

Gama11
  • 31,714
  • 9
  • 78
  • 100
  • Having a consistent formatting is more important than the details of what that formatting is. The default for a popular editor is probably a good choice. If you ever work professionally you will likely have a style guide handed to you: you will rarely have the option to format your code strictly to your tastes. I'm not posting this as an answer because it doesn't really answer the question, but my *advice* is to avoid getting too attached to any particular format...but FWIW yeah that looks like a possible bug in the formatter. – Jared Smith Feb 18 '20 at 14:31
  • Yeah, I know, but that particular thing seemed odd and I wanted to know if it was intentional or maybe some kind of bug and how to solve it – Guillermo Martínez Feb 18 '20 at 16:15

0 Answers0