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

Incorrect formating with semicolon-less code #323

Closed
jdavisclark opened this issue Sep 3, 2013 · 1 comment
Closed

Incorrect formating with semicolon-less code #323

jdavisclark opened this issue Sep 3, 2013 · 1 comment

Comments

@jdavisclark
Copy link

from @derekchiang in jdc0589/JsFormat #75. I realize this is a continuation of #56 and #200, but was told to filed an issue regardless.


Consider this piece of code:

var whatever = require('whatever')
function() {...}

Using JsFormat, this code will be formatted to:

var whatever = require('whatever')
    function() {...}  // indentation at the beginning of the line

Specifically, it seems like whenever there is a bracket following by a function, JsFormat would indent the function definition (incorrectly).

@bitwiseman
Copy link
Member

So, this code should look the same as if there was a semicolon in there:

var whatever = require('whatever');
function() {...}

Yes, this is related to #200, but we should see if we can fix it. Especially with keywords like function, but also for words in general.

var whatever = require('whatever')
require('something-else')

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