js-beautify icon indicating copy to clipboard operation
js-beautify copied to clipboard

Excess indentation on assignment destructuring.

Open prettydiff opened this issue 8 years ago • 3 comments

Description

This is the default template for bug reports, if you have a more general issue, question, or request, you may ignore this template and write freeform.

NOTE:

  • Do not include screenshots! This library is a text processor, we need text inputs and outputs for debugging and fixing issues.
  • Check the list of open issues before filing a new issue.

Input

The code looked like this before beautification:

const {
    shouldSave = true,
    Controller,
    updateLinks = true
} = options;

Expected Output

The code should have looked like this after beautification:

const {
    shouldSave = true,
    Controller,
    updateLinks = true
} = options;

Actual Output

The code actually looked like this after beautification:

const {
    shouldSave = true,
        Controller,
        updateLinks = true
} = options;

This is coming from https://github.com/Glavin001/atom-beautify/issues/1508#issuecomment-278302531 with the debug.md at https://gist.github.com/guiguan/7ad6ac4132c18f4f1ee3c6f1138abf38

prettydiff avatar Feb 08 '17 11:02 prettydiff

@prettydiff - Pointer to the syntax reference for this?

bitwiseman avatar Feb 08 '17 20:02 bitwiseman

I am thinking it is this - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment

For the best example search the page for metadata

prettydiff avatar Feb 08 '17 21:02 prettydiff

The fix will require adding a new "MODE", so this is basically blocked waiting on the javascript parsing project.

MacKLess avatar Sep 21 '18 22:09 MacKLess