1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | 'use strict';
|
18 |
|
19 | var linter = require('../lib/linter.js');
|
20 |
|
21 | module.exports = {
|
22 | topic: 'lightning',
|
23 | command: 'lint',
|
24 | description: 'Linter for Lightning Components',
|
25 | help: 'Example:\n $ heroku lightning:lint ./path/to/be/linted/',
|
26 | args: [
|
27 | {
|
28 | name: 'path'
|
29 | }
|
30 | ],
|
31 | flags: [
|
32 | {
|
33 | name: 'ignore',
|
34 | char: 'i',
|
35 | hasValue: true,
|
36 | description: 'Pattern to ignore some folders. Example: --ignore **/foo/**'
|
37 | },
|
38 | {
|
39 | name: 'files',
|
40 | hasValue: true,
|
41 | description: 'Pattern to include specific files. Defaults to all .js files. Example: --files **/*Controller.js'
|
42 | },
|
43 | {
|
44 | name: 'json',
|
45 | char: 'j',
|
46 | hasValue: false,
|
47 | description: 'Output JSON to facilitate integration with other tools. Defaults to standard text output format. Example: --json'
|
48 | },
|
49 | {
|
50 | name: 'config',
|
51 | hasValue: true,
|
52 | description: 'Path to a custom ESLint configuration. Only code styles rules will be picked up, the rest will be ignored. Example: --config path/to/.eslintrc'
|
53 | },
|
54 | {
|
55 | name: 'verbose',
|
56 | hasValue: false,
|
57 | description: 'Report warnings in addition to errors. Defaults to reporting only errors. Example: --verbose'
|
58 |
|
59 | }
|
60 | ],
|
61 | run: function(context) {
|
62 | linter(context.args.path, context.flags, {
|
63 | cwd: context.cwd
|
64 | });
|
65 | }
|
66 | };
|