Lint your CoffeeScript by CoffeeLint.
Install npm package, next to your project's Gruntfile.js
file:
npm install grunt-coffeelint
Add this line to your project's Gruntfile.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: {
src: ['tests/*.coffee']
},
options: {
'no_trailing_whitespace': {
'level': 'error'
}
}
}
},
...
});
grunt.initConfig({
...
coffeelint: {
options: {
'no_trailing_whitespace': {
'level': 'error'
}
}
},
...
});
For available options see example configuration or coffeelint homepage.