0

When I want to set "Underscore" (I used to use 'Grunt') and I put in .jshintrc.

"globals": {
  "_": false,

Now with version 3.5.1 of Jhipster I use Gulp and I do not know how to configure it because there is no file .jshintrc. Ans it gives me the error

angular.js:13550 ReferenceError: _ is not defined

Can somebody help me. Thank you.

Jose
  • 1,779
  • 4
  • 26
  • 50

1 Answers1

1

JHipster replaced jshint with eslint in this change. Because of this, you should add the globals section to the file .eslintrc.json the same as it was in .jshintrc. (Similar issue)

Based on the ReferenceError from Angular, it looks like you don't have Underscore as a dependency in your index.html. Run bower install underscore --save to download and install Underscore (this adds it to bower.json), then run gulp inject:dep to inject the dependencies to index.html automatically.

Community
  • 1
  • 1
Jon Ruddell
  • 6,244
  • 1
  • 22
  • 40