difference between globals and predef in .jshintrc? difference between globals and predef in .jshintrc? node.js node.js

difference between globals and predef in .jshintrc?


It seems like predef is deprecated and you should use globals instead.

More information here


At JSHint Doc page http://www.jshint.com/docs/ "predef" is mention for use inside .jshintrc file,wile word "globals" is used only once for inline directive (those that are inside .js files)

So examples would be :

  • inside .jshintrc file

    "predef" : [ // Extra globals             "angular",]
  • inside .js files

    /* global app: false */

So it would be better to use different words when doing the same but in different places.