Skip to content

Commit

Permalink
Misc: skip checking for incorrectly formatted jsdoc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexej Yaroshevich committed Aug 2, 2015
1 parent 140dfd6 commit 43bfdeb
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/rules/validate-jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ module.exports.prototype = {
}

validators = _this._rulesForTags[scope];
if (!validators || !node.jsdoc) {
if (!validators || !node.jsdoc || !node.jsdoc.valid) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/validate-jsdoc/check-param-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports.options = {
* @param {Function} err
*/
function validateCheckParamNames(node, err) {
if (!node.jsdoc) {
if (!node.jsdoc || !node.jsdoc.valid) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/validate-jsdoc/check-redundant-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports.options = {
function checkRedundantAccess(node, err) {
var enforceLeadingUnderscore = this._options.checkRedundantAccess === 'enforceLeadingUnderscore';
var enforceTrailingUnderscore = this._options.checkRedundantAccess === 'enforceTrailingUnderscore';
if (!node.jsdoc) {
if (!node.jsdoc || !node.jsdoc.valid) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/validate-jsdoc/check-redundant-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports.options = {
* @param {Function} err
*/
function validateCheckParamNames(node, err) {
if (!node.jsdoc) {
if (!node.jsdoc || !node.jsdoc.valid) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/validate-jsdoc/leading-underscore-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var nativeUnderscoredProperties = [
*/
function validateLeadingUnderscoresAccess(node, err) {
var option = this._options.leadingUnderscoreAccess;
if (!node.jsdoc) {
if (!node.jsdoc || !node.jsdoc.valid) {
return;
}

Expand Down
24 changes: 24 additions & 0 deletions test/lib/rules/validate-jsdoc/leading-underscore-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,30 @@ describe('lib/rules/validate-jsdoc/leading-underscore-access', function () {
*/
var __proto__ = function (p) {};
}
}, {
it: 'should not report private functions. jscs-dev/node-jscs#1588',
rules: {leadingUnderscoreAccess: 'private'},
code: function () {
/**
* @access private
*/
function _super(p) {};

/**
* @private
*/
function _proto(p) {};
}
}, {
it: 'should not report incorrect jsdoc with right tag. jscs-dev/node-jscs#1588',
rules: {leadingUnderscoreAccess: 'private'},
code: function() {
/**
* @private
**/
function _yay(yey) {
}
}
}, {
it: 'should not report overriden methods. #114',
rules: {leadingUnderscoreAccess: 'private'},
Expand Down

0 comments on commit 43bfdeb

Please sign in to comment.