Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keepEmptyLines: 1 #24

Closed
goloroden opened this issue Mar 7, 2013 · 3 comments
Closed

keepEmptyLines: 1 #24

goloroden opened this issue Mar 7, 2013 · 3 comments

Comments

@goloroden
Copy link
Contributor

If I run esformatter against

function add(a,b)
{
return a+b;
}


function sub(a,b)
{ return a-b;}

I get

function add(a, b) {
    return a + b;
}


function sub(a, b) {
    return a - b;
}

Shouldn't it be:

function add(a, b) {
    return a + b;
}

function sub(a, b) {
    return a - b;
}

(Only one single empty line according to keepEmptyLines: 1 instead of two lines?)

@millermedeiros
Copy link
Owner

we will add more options about how the empty lines will be handled, allowing to keep/add/remove/limit the amount (see #1).

On my own code I've been using 2-3 lines to split each method and 1 line inside the function body to split rules by proximity, see hooks.js that helps me a lot to navigate the files on Vim (pressing { and } jumps to next/prev empty line) and I also thinks it helps on the readability (large paragraphs are harder to read).

@goloroden
Copy link
Contributor Author

Just a guess: Does the 1 mean true? (I though it means: Keep 1 line, and remove all additional lines)

PS: Okay, after looking at #1 I understand.

@millermedeiros
Copy link
Owner

I'm closing this issue as a duplicate of #1

uiur pushed a commit to uiur/esformatter that referenced this issue Aug 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants