This is my first post (so if i've done something wrong please let me know), I've had a look through the forum and through the jshint documentation but haven't been able to find an answer so far.
I've found this post describing a similar problem Expected "{" and instead saw "return"
I am running the following code through jshint
if (!x) return;
which is returning the error "Expected '{' and instead saw 'return'"
From the other post I believe this is valid syntax but does anyone know how to configure jshint to ignore it? This is the gruntFile.js I am using
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files:['./src/*.js','!gruntFile.js'],
options:{
"curly": true,
"eqnull": true,
"eqeqeq": true,
"undef": false,
"esversion": 6,
"globals":{
"jQuery": true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task(s).
grunt.registerTask('default', ["jshint"]);
};
I'm sure it's something very simple but any help would be great.
Thanks