UNPKG

2.14 kBJavaScriptView Raw
1/*
2 * Copyright (C) 2016 salesforce.com, inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17'use strict';
18
19var linter = require('../lib/linter.js');
20
21module.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};