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

in the .vue file space_after_anon_function is invalid #1425

Closed
hxkuc opened this issue Jun 27, 2018 · 5 comments
Closed

in the .vue file space_after_anon_function is invalid #1425

hxkuc opened this issue Jun 27, 2018 · 5 comments

Comments

@hxkuc
Copy link

hxkuc commented Jun 27, 2018

Description

In the .vue file
set
'space_after_anon_function': true

Example 1:

new Vue({
  name: 'myName',
  data() {
    // some value
  }
})
// Should look like
new Vue({
  name: 'myName',
  data () {
  }
})

Example 2:

async() => {}
// should look like
async () => {}
@121595113
Copy link
Contributor

and @bitwiseman

new Vue({
  data () {
   },
   name: 'myName',

})

should to be

new Vue({
  data () {
  },
  name: 'myName',
})

Notice the alignment

@win7killer
Copy link

It's not about Vue.
Just like this:

let obj = {
    init() {
        // do something
    }
}

should be:

let obj = {
    init () {
        // do something
    }
}

@beautifier beautifier deleted a comment from hxkuc Oct 24, 2018
@bitwiseman
Copy link
Member

@win7killer @hxkuc @121595113
I've reformatted this issue a bit. I'm still unclear about how the expected behavior is supposed to work.
To be specific:
@121595113 The alignment is as you specified.
@hxkuc Example 2 matches current output in 1.8.8 how should it change.
@win7killer your example and @hxkuc Example 1 are not anon functions but rather some other thing. Maybe space_after_named_function maybe?

@121595113
Copy link
Contributor

@bitwiseman space_after_named_function I agree

@bitwiseman
Copy link
Member

@121595113 cool, so this is bug related to #608.

bitwiseman pushed a commit to 121595113/js-beautify that referenced this issue Nov 17, 2018
bitwiseman pushed a commit to 121595113/js-beautify that referenced this issue Nov 29, 2018
bitwiseman added a commit that referenced this issue Nov 29, 2018
in the .vue file `space_after_anon_function` is invalid #1425
@bitwiseman bitwiseman added this to the v1.8.x milestone Nov 29, 2018
@bitwiseman bitwiseman modified the milestones: v1.8.x, v1.8.9 Dec 6, 2018
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

5 participants