Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit64f660d

Browse files
bubenkofftmcw
authored andcommitted
feat: Support--shallow argument forlint command.Closes#956 (#995)
1 parent37a91b2 commit64f660d

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',asyncfunction(){
233+
constdata=awaitdocumentation(
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',asyncfunction(){
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+
functionadd(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+
vardep=require('./lint.input.dependency');
2+
3+
/**
4+
*@param {string} a
5+
*@param {boolean} b
6+
*/
7+
functionadd(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
constdocumentation=require('../');
44
constfs=require('fs');
55
constpath=require('path');
6+
constsharedOptions=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)

[8]ページ先頭

©2009-2025 Movatter.jp