jscs-jsdoc icon indicating copy to clipboard operation
jscs-jsdoc copied to clipboard

Smarty type testing for params and returns

Open qfox opened this issue 10 years ago • 1 comments

For example:

/**
 * Shouldn't report
 * @param {String} a
 * @returns {String}
 */
function (a) {
  if (a.indexOf('x')) {
    return '?';
  }
  return a + 'b';
}

/**
 * But this should report
 * @param {Number} b
 * @returns {String}
 */
function (b) {
  return b.quantity / 2;
}

qfox avatar Nov 04 '14 01:11 qfox

Very close to #31

qfox avatar Nov 05 '14 23:11 qfox