jish/pre-commit

please use the original JSHint default

Closed this issue · 9 comments

have a hack jshint is not a good idea

can you please refer to a commit or give a better description - the jshint is included in defaults

the jshint in pre-commit do not like original one, it dont read my .jshintrc in project, or it cant understand my .jshintrc, in my os, jshint version is v2.3.0

is it about this change 27e0958 or yet something else?

it cant understand my .jshintrc

like

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

so it worked previously and is not working anymore, or you used other method of checking - can you give more details on the thing that worked for you?

I use jshint with grunt, it work!
2013-12-24 ÉÏÎç11:46ÓÚ "Michal Papis" notifications@github.comдµÀ£º

so it worked previously and is not working anymore, or you used other
method of checking - can you give more details on the thing that worked for
you?

¡ª
Reply to this email directly or view it on GitHubhttps://github.com//issues/94#issuecomment-31157138
.

so I have added tests that confirm that proper config file is used and works:

{
  "asi": true,
  "lastsemic": true
}

and that broken file does not work:

{
  "asi": true,
  "lastsemic": true
}
}

can you confirm your file is valid? maybe you are using some flags that are not yet available in the version shipped with pre-commit - I have tried updating to the 2.4 version but it did not worked (open separate ticket if you need newer version).

file .jshintrc
{
    "node": true,
    "browser": true,
    "esnext": true,
    "bitwise": true,
    "camelcase": false,
    "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,
        "chrome": false
    }
}
test.js
(function() {
  'use strict';
  angular.module('app').controller('TestCtrl', function($scope) {
    $scope.test = function() {
      return chrome.app.window.create('test.html', {
        id: 'mocha'
      });
    };
  });
}).call(this);

check it with jshint, it pass
but pre-commit did not pass

ok this should do it ... but I had to remove "immed": true, to avoid this error:

[{
  "id"        => "(error)", 
  "raw"       => "Move the invocation into the parens that contain the function.", 
  "evidence"  => "}).call(this);", 
  "line"      => 10, 
  "character" => 3, 
  "reason"    => "Move the invocation into the parens that contain the function.",
}]

and it makes sense from the description of the error ... at least as much as I understand it - please let us know if I misunderstand the flag