Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-1641

Adding real formatting/beautifier for JS

    XMLWordPrintableJSON

Details

    Description

      When I try to format JS code which looks like this:

      var test = {foo: [{bar: 3}]};var test2 = {foo: [{bar: 3}]};var test3 = {foo: {bar: [4]}};

      It will format it like this:

      var test = {foo: [{bar: 3}]};
      var test2 = {foo: [{bar: 3}]};
      var test3 = {foo: {bar: [4]}};
      

      But expected behavior is a well formatted/beautified JS code, which should look like this:

      var test = {
          foo: [
              {
                  bar: 3
              }
          ]
      };
      
      var test2 = {
          foo: [{
              bar: 3
          }]
      };
      
      var test3 = {
          foo: {
              bar: [4]
          }
      };
      

      Based on the formatting rules.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chrizzly Christian Lenz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: