3

I get this warning:

"Use the function form of "use strict"

when gulp watch my js files.

How to solve this? I´m using gulp, gulp-babel and gulp-jshint.

Code ex:

.pipe( babel() )
.pipe( jshint( ".jshintrc" ) )

I´m not writting the 'use strict' on my code. It was generated by babel.

Leonid Beschastny
  • 50,364
  • 10
  • 118
  • 122
Patric
  • 763
  • 1
  • 8
  • 17
  • http://stackoverflow.com/questions/4462478/jslint-is-suddenly-reporting-use-the-function-form-of-use-strict – Scott Sep 03 '15 at 19:27
  • Just don't use jshint. Or rather, pipe it *before* your `babel()`. You should lint your ES6 code, not something that a transpiler produces. – Bergi Sep 03 '15 at 19:42
  • gulp-jshint works on all ES6 specs? – Patric Sep 03 '15 at 19:44
  • @Patric: I don't know that - try it. If not, check the docs (possibly it needs a flag) and maybe a) file it as a bug report b) use a different linter. – Bergi Sep 03 '15 at 19:48

1 Answers1

3

To reiterate what Bergi said in the comments, you shouldn't be linting code that you didn't write. You should switch the order and run jshint before using babel.

Mike S.
  • 969
  • 5
  • 13