Skip to content

Commit 64f660d

Browse files
bubenkofftmcw
authored andcommitted
feat: Support --shallow argument for lint command. Closes #956 (#995)
1 parent 37a91b2 commit 64f660d

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

__tests__/bin.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ describe('lint command', function() {
228228
expect(err.code > 0).toBeTruthy();
229229
}
230230
});
231+
232+
test('generates lint output with shallow', async function() {
233+
const data = await documentation(
234+
['lint fixture/lint/lint.input.shallow.js --shallow'],
235+
{},
236+
false
237+
);
238+
expect(data).toBe('');
239+
});
231240
});
232241

233242
test('given no files', async function() {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @param {String} foo bar
3+
* @returns {object} bad object return type
4+
* @type {Array<object>} bad object type
5+
* @memberof notfound
6+
*/
7+
8+
/**
9+
* @param {String} baz bar
10+
* @property {String} bad property
11+
* @private
12+
*/
13+
14+
/**
15+
* @param {number} c explicit but not found
16+
*/
17+
function add(a, b) {}
18+
19+
module.exports.add = add;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var dep = require('./lint.input.dependency');
2+
3+
/**
4+
* @param {string} a
5+
* @param {boolean} b
6+
*/
7+
function add(a, b) {}

src/commands/lint.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
const documentation = require('../');
44
const fs = require('fs');
55
const path = require('path');
6+
const sharedOptions = require('./shared_options');
67

78
/* eslint no-console: 0 */
89

910
module.exports.command = 'lint [input..]';
1011
module.exports.description = 'check for common style and uniformity mistakes';
11-
module.exports.builder = {};
12+
module.exports.builder = {
13+
shallow: sharedOptions.sharedInputOptions.shallow
14+
};
1215

1316
/**
1417
* Wrap around the documentation.lint method and add the additional

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy