Skip to content

Commit 43bfdeb

Browse files
author
Alexej Yaroshevich
committed
Misc: skip checking for incorrectly formatted jsdoc blocks
Fixes jscs-dev/node-jscs#1588 Closes gh-134
1 parent 140dfd6 commit 43bfdeb

File tree

6 files changed

+29
-5
lines changed

6 files changed

+29
-5
lines changed

lib/rules/validate-jsdoc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ module.exports.prototype = {
122122
}
123123

124124
validators = _this._rulesForTags[scope];
125-
if (!validators || !node.jsdoc) {
125+
if (!validators || !node.jsdoc || !node.jsdoc.valid) {
126126
return;
127127
}
128128

lib/rules/validate-jsdoc/check-param-names.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports.options = {
1111
* @param {Function} err
1212
*/
1313
function validateCheckParamNames(node, err) {
14-
if (!node.jsdoc) {
14+
if (!node.jsdoc || !node.jsdoc.valid) {
1515
return;
1616
}
1717

lib/rules/validate-jsdoc/check-redundant-access.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports.options = {
1414
function checkRedundantAccess(node, err) {
1515
var enforceLeadingUnderscore = this._options.checkRedundantAccess === 'enforceLeadingUnderscore';
1616
var enforceTrailingUnderscore = this._options.checkRedundantAccess === 'enforceTrailingUnderscore';
17-
if (!node.jsdoc) {
17+
if (!node.jsdoc || !node.jsdoc.valid) {
1818
return;
1919
}
2020

lib/rules/validate-jsdoc/check-redundant-params.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports.options = {
1111
* @param {Function} err
1212
*/
1313
function validateCheckParamNames(node, err) {
14-
if (!node.jsdoc) {
14+
if (!node.jsdoc || !node.jsdoc.valid) {
1515
return;
1616
}
1717

lib/rules/validate-jsdoc/leading-underscore-access.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var nativeUnderscoredProperties = [
3939
*/
4040
function validateLeadingUnderscoresAccess(node, err) {
4141
var option = this._options.leadingUnderscoreAccess;
42-
if (!node.jsdoc) {
42+
if (!node.jsdoc || !node.jsdoc.valid) {
4343
return;
4444
}
4545

test/lib/rules/validate-jsdoc/leading-underscore-access.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,30 @@ describe('lib/rules/validate-jsdoc/leading-underscore-access', function () {
202202
*/
203203
var __proto__ = function (p) {};
204204
}
205+
}, {
206+
it: 'should not report private functions. jscs-dev/node-jscs#1588',
207+
rules: {leadingUnderscoreAccess: 'private'},
208+
code: function () {
209+
/**
210+
* @access private
211+
*/
212+
function _super(p) {};
213+
214+
/**
215+
* @private
216+
*/
217+
function _proto(p) {};
218+
}
219+
}, {
220+
it: 'should not report incorrect jsdoc with right tag. jscs-dev/node-jscs#1588',
221+
rules: {leadingUnderscoreAccess: 'private'},
222+
code: function() {
223+
/**
224+
* @private
225+
**/
226+
function _yay(yey) {
227+
}
228+
}
205229
}, {
206230
it: 'should not report overriden methods. #114',
207231
rules: {leadingUnderscoreAccess: 'private'},

0 commit comments

Comments
 (0)