1 | resin-lint
|
2 | ==========
|
3 |
|
4 | `resin-lint` is a linter based on [coffeelint](https://github.com/clutchski/coffeelint),
|
5 | [coffeescope2](https://github.com/za-creature/coffeescope) and [tslint](https://palantir.github.io/tslint/) that detects style errors based on Resin.io coding guidelines.
|
6 |
|
7 | Overview
|
8 | --------
|
9 |
|
10 | `resin-lint` uses Resin's `coffeelint.json` and `tslint.json`. If a `coffeelint.json` or `tslint.json` is found in the to-be-linted project
|
11 | directory or its parents then the rules found in it will override the default `resin-lint` ones.
|
12 | Another way to to override the default resin-lint rules is by specifying a configuration
|
13 | file with the `-f` parameter.
|
14 | By default, only `.coffee` files will be linted. `.ts` and `.tsx` files can be
|
15 | linted by using the `--typescript` parameter.
|
16 |
|
17 | Usage
|
18 | -----
|
19 |
|
20 | You can use this module as:
|
21 |
|
22 | 1. A standalone project by installing it with `npm install -g resin-lint`:
|
23 |
|
24 | ```
|
25 | kostas@macbook:~/resin/test$ resin-lint src/
|
26 | ✓ src/test.coffee
|
27 |
|
28 | ✓ Ok! » 0 errors and 0 warnings in 1 file
|
29 | ```
|
30 |
|
31 | 2. A development dependency in `package.json` with ```npm install --save-dev resin-lint```. Then
|
32 | you can use the module in your build/testing process:
|
33 |
|
34 | ```
|
35 | package.json
|
36 | ------------
|
37 | ...
|
38 | "scripts": {
|
39 | "lint": "resin-lint src/ && echo \"Done!\""
|
40 | },
|
41 | ...
|
42 |
|
43 | kostas@macbook:~/resin/test$ npm run lint
|
44 |
|
45 | > test@1.0.0 lint /Users/kostas/resin/test
|
46 | > resin-lint src/ && echo "Done!"
|
47 |
|
48 | ✓ src/test.coffee
|
49 |
|
50 | ✓ Ok! » 0 errors and 0 warnings in 1 file
|
51 |
|
52 | Done!
|
53 |
|
54 | ```
|
55 |
|
56 | Support
|
57 | -------
|
58 |
|
59 | If you're having any problem, please [raise an issue](https://github.com/resin-io/node-resin-lint/issues/new) on GitHub and the Resin.io team will be happy to help.
|
60 |
|
61 | Tests
|
62 | -----
|
63 |
|
64 | Run the test suite by doing:
|
65 |
|
66 | ```sh
|
67 | $ npm install && npm test
|
68 | ```
|
69 |
|
70 | Contribute
|
71 | ----------
|
72 |
|
73 | - Issue Tracker: [github.com/resin-io/node-resin-lint/issues](https://github.com/resin-io/node-resin-lint/issues)
|
74 | - Source Code: [github.com/resin-io/node-resin-lint](https://github.com/resin-io/node-resin-lint)
|
75 |
|
76 | Before submitting a PR, please make sure that you include tests, and that `npm run lint` runs without a warning.
|
77 |
|
78 | License
|
79 | -------
|
80 |
|
81 | The project is licensed under the Apache 2.0 license.
|