Skip to content

Commit

Permalink
Fix lint warnings: invalid JSDoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mroderick committed Mar 22, 2021
1 parent dd4996f commit 149938d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
21 changes: 8 additions & 13 deletions lib/sinon/util/core/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var hasOwnProperty = require("@sinonjs/commons").prototypes.object

var join = arrayProto.join;
var push = arrayProto.push;
var slice = arrayProto.slice;

// Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
var hasDontEnumBug = (function () {
Expand Down Expand Up @@ -81,14 +80,12 @@ function extendCommon(target, sources, doCopy) {
/** Public: Extend target in place with all (own) properties, except 'name' when [[writable]] is false,
* from sources in-order. Thus, last source will override properties in previous sources.
*
* @arg {Object} target - The Object to extend
* @arg {Object[]} sources - Objects to copy properties from.
* @param {object} target - The Object to extend
* @param {object[]} sources - Objects to copy properties from.
*
* @returns {Object} the extended target
* @returns {object} the extended target
*/
module.exports = function extend(target /*, sources */) {
var sources = slice(arguments, 1);

module.exports = function extend(target, ...sources) {
return extendCommon(
target,
sources,
Expand Down Expand Up @@ -119,14 +116,12 @@ module.exports = function extend(target /*, sources */) {
/** Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will
* override properties in previous sources. Define the properties as non enumerable.
*
* @arg {Object} target - The Object to extend
* @arg {Object[]} sources - Objects to copy properties from.
* @param {object} target - The Object to extend
* @param {object[]} sources - Objects to copy properties from.
*
* @returns {Object} the extended target
* @returns {object} the extended target
*/
module.exports.nonEnum = function extendNonEnum(target /*, sources */) {
var sources = slice(arguments, 1);

module.exports.nonEnum = function extendNonEnum(target, ...sources) {
return extendCommon(
target,
sources,
Expand Down
4 changes: 2 additions & 2 deletions lib/sinon/util/core/is-es-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* using spies or stubs. Let the consumer know this to avoid bug reports
* on weird error messages.
*
* @param {Object} object The object to examine
* @param {object} object The object to examine
*
* @returns {Boolean} true when the object is a module
* @returns {boolean} true when the object is a module
*/
module.exports = function (object) {
return (
Expand Down
8 changes: 5 additions & 3 deletions lib/sinon/util/core/is-non-existent-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

/**
* @param {*} object
* @param {String} property
* @returns whether a prop exists in the prototype chain
* @param {string} property
* @returns {boolean} whether a prop exists in the prototype chain
*/
function isNonExistentProperty(object, property) {
return object && typeof property !== "undefined" && !(property in object);
return Boolean(
object && typeof property !== "undefined" && !(property in object)
);
}

module.exports = isNonExistentProperty;
4 changes: 2 additions & 2 deletions lib/sinon/util/fake-timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function addIfDefined(obj, globalPropName) {
}

/**
* @param {number|Date|Object} dateOrConfig The unix epoch value to install with (default 0)
* @returns {Object} Returns a lolex clock instance
* @param {number|Date|object} dateOrConfig The unix epoch value to install with (default 0)
* @returns {object} Returns a lolex clock instance
*/
exports.useFakeTimers = function (dateOrConfig) {
var hasArguments = typeof dateOrConfig !== "undefined";
Expand Down
2 changes: 1 addition & 1 deletion test/assert-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ describe("assert", function () {
*
* In node the output uses more whitespace than in browsers.
*
* @type {Boolean}
* @type {boolean}
*/
var usesCondensedFormat =
inspect([
Expand Down

0 comments on commit 149938d

Please sign in to comment.