Spaces are not being used to align variables in Javascript var statement
See original GitHub issuePrettier 1.18.2 Playground link
--parser babylon
--single-quote
--tab-width 4
--use-tabs
Input:
function test() {
var bla,
zever = 1;
}
Output:
function test() {
var bla,
zever = 1;
}
Expected behavior:
The original tab whitespace directly in front of zever
is used for positioning, not for indenting.
Prettier should NOT replace that with a tab because it breaks the positioning (as you can see on this page, where tabs are 8 characters wide)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
JavaScript Best Practices — Spacing and Variables
Horizontal whitespace usage depends on location. We should never have trailing whitespaces. We should have whitespace to separate reserved words ...
Read more >Auto align "var" under JavaScript in PhpStorm (7.0.1)
First of all: Settings > Code Style > JavaScript > Other > Align object properties: On value has nothing to do with variable...
Read more >Multiple var statements in JavaScript, not superfluous
Of course, there's always the tabs-vs-spaces argument. Which looks better when declaring multiple variables in a single var statement, tabs or ...
Read more >var() - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The var() CSS function can be used to insert the value of a custom property (sometimes called a "CSS variable") instead of any...
Read more >JavaScript var Statement - W3Schools
var carName;. After the declaration, the variable is empty (it has no value). To assign a value to the variable, use the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Then you have a very simple solution to your problem: Ask this person to stop using Prettier! Tell them that it causes unnecessary diff which makes PRs harder to review and increases the risk of merge conflicts.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don’t have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.