1 | [![build status](https://secure.travis-ci.org/vojtajina/grunt-coffeelint.svg)](http://travis-ci.org/vojtajina/grunt-coffeelint)
|
2 | # grunt-coffeelint
|
3 |
|
4 | **Lint your CoffeeScript with [CoffeeLint].**
|
5 |
|
6 | ## Installation
|
7 |
|
8 | Install npm package, next to your project's `Gruntfile.js` file:
|
9 |
|
10 | npm install grunt-coffeelint
|
11 |
|
12 | Add this line to your project's `Gruntfile.js`:
|
13 |
|
14 | grunt.loadNpmTasks('grunt-coffeelint');
|
15 |
|
16 | ## Options
|
17 |
|
18 | A few additional options are supported:
|
19 |
|
20 | ### force
|
21 | Type: `Boolean`
|
22 | Default value: `false`
|
23 |
|
24 | Set `force` to `true` to report CoffeeLint errors but not fail the task.
|
25 |
|
26 | ## Configuration
|
27 |
|
28 | `coffeelint` is a multitask, so you can use it similary to `lint`, `watch` etc...
|
29 |
|
30 | ````javascript
|
31 | grunt.initConfig({
|
32 | ...
|
33 | coffeelint: {
|
34 | app: ['app/*.coffee', 'scripts/*.coffee']
|
35 | },
|
36 | ...
|
37 | });
|
38 | ````
|
39 |
|
40 | ### Options per target
|
41 |
|
42 | ````javascript
|
43 | grunt.initConfig({
|
44 | ...
|
45 | coffeelint: {
|
46 | app: ['app/*.coffee', 'scripts/*.coffee'],
|
47 | tests: {
|
48 | files: {
|
49 | src: ['tests/*.coffee']
|
50 | },
|
51 | options: {
|
52 | 'no_trailing_whitespace': {
|
53 | 'level': 'error'
|
54 | }
|
55 | }
|
56 | }
|
57 | },
|
58 | ...
|
59 | });
|
60 | ````
|
61 |
|
62 | ### Global - default options
|
63 |
|
64 | ````javascript
|
65 | grunt.initConfig({
|
66 | ...
|
67 | coffeelint: {
|
68 | options: {
|
69 | 'no_trailing_whitespace': {
|
70 | 'level': 'error'
|
71 | }
|
72 | }
|
73 | },
|
74 | ...
|
75 | });
|
76 | ````
|
77 |
|
78 | ### Loading external config
|
79 |
|
80 | ````javascript
|
81 | grunt.initConfig({
|
82 | ...
|
83 | coffeelint: {
|
84 | options: {
|
85 | configFile: 'coffeelint.json'
|
86 | }
|
87 | },
|
88 | ...
|
89 | });
|
90 | ````
|
91 | Task `options` take precedence over `configFile` options.
|
92 |
|
93 | For available options see [coffeelint homepage].
|
94 |
|
95 | [CoffeeLint]: http://www.coffeelint.org/
|
96 | [coffeelint homepage]: http://www.coffeelint.org/
|
97 |
|
\ | No newline at end of file |