gruntjs - jshint conflicting with jsbeautifier and complaining about indentation of square bracket in array -


i have jsbeautifer followed jshint task in gruntfile, seem have different ideas closing braces should be.

i agree jsbeautifer produces, jshint complains. here sample file have , error message below:

    0   $scope.awesomethings = [                                                                            1       'html5 boilerplate',                                                                            2       'angularjs',                                                                                    3       'karma'                                                                                     >>  4   ];            expected ']' have indentation @ 5 instead @ 3. 

this .jshintc file:

{   "node": true,   "browser": true,   "es5": true,   "esnext": true,   "bitwise": true,   "curly": true,   "eqeqeq": true,   "immed": true,   "indent": 2,   "latedef": true,   "newcap": true,   "noarg": true,   "quotmark": "single",   "regexp": true,   "undef": true,   "unused": true,   "strict": true,   "trailing": true,   "smarttabs": true,   "globals": {     "angular": false   } } 

your jsbeautifier seems indent 4 spaces, jshintrc-file set check indentation 2 spaces. set there 4 spaces if think 4 spaces want:

"indent": 4, 

edit:

if use this grunt-beautifier-plugin there option called keep_array_indentation default set default. expect fix problem.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -