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

Already on GitHub? Sign in to your account

New line above function declarations in objects #141

Open
kraftwer1 opened this Issue Aug 15, 2012 · 5 comments

Comments

Projects
None yet
3 participants
var obj = {
    qwer: "somestring",
    asdf: "someotherstring",
    dasfkej: function function_name(argument) {
        // body...
    },
    askdfj: function jfaksdjf(argument) {
        // body...
    }
};

Would change to:

var obj = {
    qwer: "somestring",
    asdf: "someotherstring",

    dasfkej: function function_name(argument) {
        // body...
    },

    askdfj: function jfaksdjf(argument) {
        // body...
    }
};

Of course, some config options would be nice, like 0, 1, 2, etc...

Contributor

bitwiseman commented Mar 15, 2013

@kraftwer1 - If you're still around could you clean up the formatting on this issue? I think I see what you're trying to say, but if you could clarify that'd be great.

There you go, sorry for the formatting.

Contributor

bitwiseman commented May 27, 2013

Thanks, BTW.

But to be clear, this is definitely how this should work - we already do it for plain function declarations.

function a() {
    return 1;
}

function b() {
    return 2;
}

This is hard issue due to #200 - we don't look ahead, and have difficulty going back to fix up. We don't know if an object member is a function until after we've already started the member. We'd have to go back to fixup the output.

@bitwiseman bitwiseman modified the milestones: v1.6.0, Future Sep 30, 2014

Contributor

bitwiseman commented Sep 30, 2014

With recent tokenizing changes, this is now possible.

@bitwiseman bitwiseman changed the title from New line above methods in objects to New line above function declarations in objects Sep 30, 2014

@bitwiseman bitwiseman modified the milestones: 2.0.0, v1.6.0 Jan 27, 2016

@bitwiseman bitwiseman modified the milestones: v1.7.x, v2.0.0 Dec 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment