Skip to content

Support --shallow argument for lint command. Closes #956 #995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions __tests__/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ describe('lint command', function() {
expect(err.code > 0).toBeTruthy();
}
});

test('generates lint output with shallow', async function() {
const data = await documentation(
['lint fixture/lint/lint.input.shallow.js --shallow'],
{},
false
);
expect(data).toBe('');
});
});

test('given no files', async function() {
Expand Down
19 changes: 19 additions & 0 deletions __tests__/fixture/lint/lint.input.dependency.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @param {String} foo bar
* @returns {object} bad object return type
* @type {Array<object>} bad object type
* @memberof notfound
*/

/**
* @param {String} baz bar
* @property {String} bad property
* @private
*/

/**
* @param {number} c explicit but not found
*/
function add(a, b) {}

module.exports.add = add;
7 changes: 7 additions & 0 deletions __tests__/fixture/lint/lint.input.shallow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var dep = require('./lint.input.dependency');

/**
* @param {string} a
* @param {boolean} b
*/
function add(a, b) {}
5 changes: 4 additions & 1 deletion src/commands/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
const documentation = require('../');
const fs = require('fs');
const path = require('path');
const sharedOptions = require('./shared_options');

/* eslint no-console: 0 */

module.exports.command = 'lint [input..]';
module.exports.description = 'check for common style and uniformity mistakes';
module.exports.builder = {};
module.exports.builder = {
shallow: sharedOptions.sharedInputOptions.shallow
};

/**
* Wrap around the documentation.lint method and add the additional
Expand Down
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