This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 244916 - angularjs project. jshint complains about the indentation provided by the editor, (for instance) Expected '}' to have an indentation at 3 instead of 9.
Summary: angularjs project. jshint complains about the indentation provided by the edi...
Status: REOPENED
Alias: None
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-05 14:25 UTC by douglasv
Modified: 2015-09-09 11:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (53.46 KB, text/plain)
2014-06-05 14:26 UTC, douglasv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description douglasv 2014-06-05 14:25:58 UTC
Product Version = NetBeans IDE 8.0 (Build 201403101706)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.0-b70
Comment 1 douglasv 2014-06-05 14:26:01 UTC
Created attachment 147585 [details]
IDE log
Comment 2 Vladimir Riha 2014-06-06 06:54:34 UTC
Could you please provide some sample code? What "}" do you mean? Thank you
Comment 3 Vladimir Riha 2014-06-06 14:09:11 UTC
According to reporter general problem with JS formatting. I tried JSlint with some code formatted by NetBeans and it shows errors. For instance:

var angular = {};
angular.module('myApp.controllers', [])
        .controller('MyCtrl1', ['$scope', function($scope) {
        'use strict';
        return 'neco';
    }])
        .controller('MyCtrl2', ['$scope', function($scope) {
        'use strict';
        return 'neco';
    }]);

NetBeans formats to

var angular = {};
angular.module('myApp.controllers', [])
        .controller('MyCtrl1', ['$scope', function($scope) {
                'use strict';
                return 'neco';
            }])
        .controller('MyCtrl2', ['$scope', function($scope) {
                'use strict';
                return 'neco';
            }]);
Comment 4 Petr Hejl 2014-06-10 10:10:27 UTC
What should be the suggested result?
Comment 5 douglasv 2014-06-10 10:25:14 UTC
the question about the } seems to be in need of an English speaker
the statement stands