From fce80b87b7fdbaed2dea50937d72231330cfdad7 Mon Sep 17 00:00:00 2001 From: Alexey Bezhan Date: Mon, 6 Nov 2017 17:37:15 +0000 Subject: [PATCH] Move jshint configuration to .jshintrc When provided with inline configuration in a gulp task jshint will still try to load a configuration file from the current directory or the user's home directory. If user has a global .jshintrc file that sets different linting options this could lead to `npm test` output being different from the CI one. jshint only uses the first file it finds, and .jshintrc in current directory or any parent of the current directory takes precedence over the user one, so moving jshint configuration from gulpfile to .jshintrc should make `npm test` produce the same outcome regardless of the user config. --- .jshintrc | 1 + gulpfile.babel.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .jshintrc diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000000000..368bcf310 --- /dev/null +++ b/.jshintrc @@ -0,0 +1 @@ +{"esversion": 6, "esnext": false} diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 9ecc9c15d..872630dfb 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -138,7 +138,7 @@ gulp.task('lint:sass', () => gulp gulp.task('lint:js', () => gulp .src(paths.src + 'javascripts/**/*.js') - .pipe(plugins.jshint({'esversion': 6, 'esnext': false})) + .pipe(plugins.jshint()) .pipe(plugins.jshint.reporter(stylish)) .pipe(plugins.jshint.reporter('fail')) );