Lint your CoffeeScript by CoffeeLint.
Install npm package, next to your project's grunt.js
file:
npm install grunt-coffeelint
Add this line to your project's grunt.js
:
grunt.loadNpmTasks('grunt-coffeelint');
coffeelint
is a multitask, so you can use it similary to lint
, watch
etc...
grunt.initConfig({
...
coffeelint: {
app: ['app/*.coffee', 'scripts/*.coffee']
}
},
...
});
grunt.initConfig({
...
coffeelint: {
app: ['app/*.coffee', 'scripts/*.coffee'],
tests: {
files: ['tests/*.coffee'],
options: {
"no_trailing_whitespace": {
"level": "error"
}
}
}
},
...
});
grunt.initConfig({
...
coffeelintOptions: {
"no_trailing_whitespace": {
"level": "error"
}
},
...
});
For available options see example configuration or coffeelint homepage.