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

Vue maxPreserveNewlines one less than setting for js/css #1968

Closed
5 tasks done
mokkabonna opened this issue Dec 1, 2017 · 10 comments
Closed
5 tasks done

Vue maxPreserveNewlines one less than setting for js/css #1968

mokkabonna opened this issue Dec 1, 2017 · 10 comments

Comments

@mokkabonna
Copy link

Description

I have set max_preserve_newlines: 2

Only the html template seems to get the correct amount of newlines.

Input Before Beautification

This is what the code looked like before: (3 newlines for all)

<template>
<div>



  <div>
  </div>
</div>
</template>
<script>
import foo from 'foo'



export default {}
</script>
<style lang="scss" scoped>
.class1 {}



.class2 {}
</style>

Expected Output

The beautified code should have looked like this: (2 newlines for all)

<template>
<div>


  <div>
  </div>
</div>
</template>
<script>
import foo from 'foo'


export default {}
</script>
<style lang="scss" scoped>
.class1 {}


.class2 {}
</style>

Actual Output

The beautified code actually looked like this: (2 for html 1 for js/css)

<template>
<div>


  <div>
  </div>
</div>
</template>
<script>
import foo from 'foo'

export default {}
</script>
<style lang="scss" scoped>
.class1 {}

.class2 {}
</style>

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right!

Debug

Here is a link to the debug.md Gist: https://gist.github.com/mokkabonna/f03f1684426ca7fc7140a90b47168552

Checklist

I have:

  • Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • Reloaded (or restarted) Atom to ensure it is not a caching issue
  • Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue
@stale
Copy link

stale bot commented Jan 30, 2018

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 30, 2018
@mokkabonna
Copy link
Author

This is still an issue.

@stale stale bot removed the stale label Feb 2, 2018
@stale
Copy link

stale bot commented Apr 3, 2018

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 3, 2018
@stale stale bot closed this as completed Apr 10, 2018
@mokkabonna
Copy link
Author

Still an issue

@stevenzeck stevenzeck added bug and removed stale labels Apr 10, 2018
@stevenzeck stevenzeck reopened this Apr 10, 2018
@stevenzeck
Copy link
Contributor

@bitwiseman

@bitwiseman
Copy link
Contributor

@szeck87 This issue does not repro on http://jsbeautifier.org/ .

@stevenzeck
Copy link
Contributor

My bad, it goes through a few different pipelines.

@stevenzeck
Copy link
Contributor

Yea, a lot issues with https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/vue-beautifier.coffee. For one, we're not transforming the options that are passed into prettydiff.

@bitwiseman
Copy link
Contributor

@szeck87 No problem.

@stale
Copy link

stale bot commented Jun 10, 2018

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

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

3 participants