question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

javascript ternary condition insert extra spaces

See original GitHub issue

With a config : "prettier.tabWidth": 2 i got this :

prettier

resulting in 6 spaces for 2 tab indentations.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
jlongstercommented, Feb 28, 2017

Closing as it was intended. If enough people don’t like this we can talk about it more, so please forward them here and we can re-open 😃

1reaction
yamafaktorycommented, Feb 27, 2017

@rhengles Yeah you’re right, this is clearly set like you said as I can see so far in the tests. So in the end, this is not an issue but totally intended to be as it is. I was starting to mix everything in my mind !

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSLint warns about ternary operator - javascript - Stack Overflow
The ternary operator can be visually confusing, so ? question mark and : colon always begin a line and increase the indentation by...
Read more >
JavaScript Ternary Operator - GeeksforGeeks
Ternary Operator : The “Question mark” or “conditional” operator in JavaScript is a ternary operator that has three operands.
Read more >
Guide to the Ternary Operator in JavaScript - Stack Abuse
A ternary operator is a three-operand operator that is supported in most programming languages, including JavaScript, Java, C++, C#, ...
Read more >
Ternary conditional operator - Wikipedia
In computer programming, the ternary conditional operator is a ternary operator that is part of the syntax for basic conditional expressions in several ......
Read more >
Conditional (ternary) operator - JavaScript - MDN Web Docs
The conditional (ternary) operator is the only JavaScript operator that takes three operands: a condition followed by a question mark (?)
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found