Artif3x
Artif3x

Reputation: 4661

JSLint error in Gruntfile.js

I've written a Gruntfile.js where I call grunt.file.delete(), and JSLint is barking at me, saying, "Expected an identifier and instead saw 'delete' (a reserved word). grunt.file.delete(config[task].dest);"

config is an object, task a string matching the task name, and dest a path string.

I already have /*jslint node:true */ set at the top of the file.

Does anyone know if this is a valid issue, and if it is, what's the basis and what do I do to fix it?

Upvotes: 0

Views: 151

Answers (1)

dave mankoff
dave mankoff

Reputation: 17789

According to https://github.com/gruntjs/grunt/issues/752

If you enable the es5 option for linting your Gruntfile with JSHint, this error should go away.

Alternatively, just change grunt.file.delete to grunt.file['delete']

Upvotes: 2

Related Questions