Lint your Coffee & React CJSX
npm install grunt-coffeelint-cjsxLint your CoffeeScript with CoffeeLint & React CJSX
This uses emorikawa/coffeelint-cjsx, which is a React-specific fork of clutchski/coffeelint. This is for React 0.12 syntax.
Install npm package, next to your project's Gruntfile.js file:
npm install grunt-coffeelint-cjsx
Add this line to your project's Gruntfile.js:
grunt.loadNpmTasks('grunt-coffeelint-cjsx');
A few additional options are supported:
BooleanfalseSet force to true to report CoffeeLint errors but not fail the task.
coffeelint is a multitask, so you can use it similary to lint, watch etc...
```javascript``
grunt.initConfig({
...
coffeelint: {
app: ['app/.coffee', 'scripts/.coffee']
},
...
});
``javascript``
grunt.initConfig({
...
coffeelint: {
app: ['app/.coffee', 'scripts/.coffee'],
tests: {
files: {
src: ['tests/*.coffee']
},
options: {
'no_trailing_whitespace': {
'level': 'error'
}
}
}
},
...
});
``javascript``
grunt.initConfig({
...
coffeelint: {
options: {
'no_trailing_whitespace': {
'level': 'error'
}
}
},
...
});
``javascript``
grunt.initConfig({
...
coffeelint: {
options: {
configFile: 'coffeelint.json'
}
},
...
});options
Task take precedence over configFile` options.
For available options see [coffeelint homepage].
[CoffeeLint]: http://www.coffeelint.org/
[coffeelint homepage]: http://www.coffeelint.org/