Last change
on this file since 484 was
484,
checked in by hendrikvanantwerpen, 11 years ago
|
Commit node_modules, to make checkouts and builds more deterministic.
|
File size:
1.4 KB
|
Line | |
---|
1 | [](http://travis-ci.org/vojtajina/grunt-coffeelint) |
---|
2 | # grunt-coffeelint |
---|
3 | |
---|
4 | **Lint your CoffeeScript by [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 | |
---|
17 | ## Configuration |
---|
18 | |
---|
19 | `coffeelint` is a multitask, so you can use it similary to `lint`, `watch` etc... |
---|
20 | |
---|
21 | ````javascript |
---|
22 | grunt.initConfig({ |
---|
23 | ... |
---|
24 | coffeelint: { |
---|
25 | app: ['app/*.coffee', 'scripts/*.coffee'] |
---|
26 | } |
---|
27 | }, |
---|
28 | ... |
---|
29 | }); |
---|
30 | ```` |
---|
31 | |
---|
32 | ### Options per target |
---|
33 | |
---|
34 | ````javascript |
---|
35 | grunt.initConfig({ |
---|
36 | ... |
---|
37 | coffeelint: { |
---|
38 | app: ['app/*.coffee', 'scripts/*.coffee'], |
---|
39 | tests: { |
---|
40 | files: { |
---|
41 | src: ['tests/*.coffee'] |
---|
42 | }, |
---|
43 | options: { |
---|
44 | 'no_trailing_whitespace': { |
---|
45 | 'level': 'error' |
---|
46 | } |
---|
47 | } |
---|
48 | } |
---|
49 | }, |
---|
50 | ... |
---|
51 | }); |
---|
52 | ```` |
---|
53 | |
---|
54 | ### Global - default options |
---|
55 | |
---|
56 | ````javascript |
---|
57 | grunt.initConfig({ |
---|
58 | ... |
---|
59 | coffeelint: { |
---|
60 | options: { |
---|
61 | 'no_trailing_whitespace': { |
---|
62 | 'level': 'error' |
---|
63 | } |
---|
64 | } |
---|
65 | }, |
---|
66 | ... |
---|
67 | }); |
---|
68 | ```` |
---|
69 | |
---|
70 | For available options see [example configuration] or [coffeelint homepage]. |
---|
71 | |
---|
72 | |
---|
73 | [CoffeeLint]: http://www.coffeelint.org/ |
---|
74 | [coffeelint homepage]: http://www.coffeelint.org/ |
---|
75 | [example configuration]: https://raw.github.com/clutchski/coffeelint/master/examples/coffeelint.json |
---|
Note: See
TracBrowser
for help on using the repository browser.